(function (de, m) {
  typeof exports == "object" && typeof module < "u"
    ? m(exports, require("vue"), require("element-plus"))
    : typeof define == "function" && define.amd
      ? define(["exports", "vue", "element-plus"], m)
      : ((de = typeof globalThis < "u" ? globalThis : de || self),
        m((de.XdeUI = {}), de.Vue, de.ElementPlus));
})(this, function (de, m, ve) {
  "use strict";
  var Ce =
    typeof globalThis < "u"
      ? globalThis
      : typeof window < "u"
        ? window
        : typeof global < "u"
          ? global
          : typeof self < "u"
            ? self
            : {};
  function Dt(d) {
    return d &&
      d.__esModule &&
      Object.prototype.hasOwnProperty.call(d, "default")
      ? d.default
      : d;
  }
  var Xe = { exports: {} };
  (function (d, C) {
    (function ($) {
      d.exports = $();
    })(function ($) {
      var R = [
        "0",
        "1",
        "2",
        "3",
        "4",
        "5",
        "6",
        "7",
        "8",
        "9",
        "a",
        "b",
        "c",
        "d",
        "e",
        "f",
      ];
      function M(p, l) {
        var o = p[0],
          n = p[1],
          r = p[2],
          i = p[3];
        ((o += (((n & r) | (~n & i)) + l[0] - 680876936) | 0),
          (o = (((o << 7) | (o >>> 25)) + n) | 0),
          (i += (((o & n) | (~o & r)) + l[1] - 389564586) | 0),
          (i = (((i << 12) | (i >>> 20)) + o) | 0),
          (r += (((i & o) | (~i & n)) + l[2] + 606105819) | 0),
          (r = (((r << 17) | (r >>> 15)) + i) | 0),
          (n += (((r & i) | (~r & o)) + l[3] - 1044525330) | 0),
          (n = (((n << 22) | (n >>> 10)) + r) | 0),
          (o += (((n & r) | (~n & i)) + l[4] - 176418897) | 0),
          (o = (((o << 7) | (o >>> 25)) + n) | 0),
          (i += (((o & n) | (~o & r)) + l[5] + 1200080426) | 0),
          (i = (((i << 12) | (i >>> 20)) + o) | 0),
          (r += (((i & o) | (~i & n)) + l[6] - 1473231341) | 0),
          (r = (((r << 17) | (r >>> 15)) + i) | 0),
          (n += (((r & i) | (~r & o)) + l[7] - 45705983) | 0),
          (n = (((n << 22) | (n >>> 10)) + r) | 0),
          (o += (((n & r) | (~n & i)) + l[8] + 1770035416) | 0),
          (o = (((o << 7) | (o >>> 25)) + n) | 0),
          (i += (((o & n) | (~o & r)) + l[9] - 1958414417) | 0),
          (i = (((i << 12) | (i >>> 20)) + o) | 0),
          (r += (((i & o) | (~i & n)) + l[10] - 42063) | 0),
          (r = (((r << 17) | (r >>> 15)) + i) | 0),
          (n += (((r & i) | (~r & o)) + l[11] - 1990404162) | 0),
          (n = (((n << 22) | (n >>> 10)) + r) | 0),
          (o += (((n & r) | (~n & i)) + l[12] + 1804603682) | 0),
          (o = (((o << 7) | (o >>> 25)) + n) | 0),
          (i += (((o & n) | (~o & r)) + l[13] - 40341101) | 0),
          (i = (((i << 12) | (i >>> 20)) + o) | 0),
          (r += (((i & o) | (~i & n)) + l[14] - 1502002290) | 0),
          (r = (((r << 17) | (r >>> 15)) + i) | 0),
          (n += (((r & i) | (~r & o)) + l[15] + 1236535329) | 0),
          (n = (((n << 22) | (n >>> 10)) + r) | 0),
          (o += (((n & i) | (r & ~i)) + l[1] - 165796510) | 0),
          (o = (((o << 5) | (o >>> 27)) + n) | 0),
          (i += (((o & r) | (n & ~r)) + l[6] - 1069501632) | 0),
          (i = (((i << 9) | (i >>> 23)) + o) | 0),
          (r += (((i & n) | (o & ~n)) + l[11] + 643717713) | 0),
          (r = (((r << 14) | (r >>> 18)) + i) | 0),
          (n += (((r & o) | (i & ~o)) + l[0] - 373897302) | 0),
          (n = (((n << 20) | (n >>> 12)) + r) | 0),
          (o += (((n & i) | (r & ~i)) + l[5] - 701558691) | 0),
          (o = (((o << 5) | (o >>> 27)) + n) | 0),
          (i += (((o & r) | (n & ~r)) + l[10] + 38016083) | 0),
          (i = (((i << 9) | (i >>> 23)) + o) | 0),
          (r += (((i & n) | (o & ~n)) + l[15] - 660478335) | 0),
          (r = (((r << 14) | (r >>> 18)) + i) | 0),
          (n += (((r & o) | (i & ~o)) + l[4] - 405537848) | 0),
          (n = (((n << 20) | (n >>> 12)) + r) | 0),
          (o += (((n & i) | (r & ~i)) + l[9] + 568446438) | 0),
          (o = (((o << 5) | (o >>> 27)) + n) | 0),
          (i += (((o & r) | (n & ~r)) + l[14] - 1019803690) | 0),
          (i = (((i << 9) | (i >>> 23)) + o) | 0),
          (r += (((i & n) | (o & ~n)) + l[3] - 187363961) | 0),
          (r = (((r << 14) | (r >>> 18)) + i) | 0),
          (n += (((r & o) | (i & ~o)) + l[8] + 1163531501) | 0),
          (n = (((n << 20) | (n >>> 12)) + r) | 0),
          (o += (((n & i) | (r & ~i)) + l[13] - 1444681467) | 0),
          (o = (((o << 5) | (o >>> 27)) + n) | 0),
          (i += (((o & r) | (n & ~r)) + l[2] - 51403784) | 0),
          (i = (((i << 9) | (i >>> 23)) + o) | 0),
          (r += (((i & n) | (o & ~n)) + l[7] + 1735328473) | 0),
          (r = (((r << 14) | (r >>> 18)) + i) | 0),
          (n += (((r & o) | (i & ~o)) + l[12] - 1926607734) | 0),
          (n = (((n << 20) | (n >>> 12)) + r) | 0),
          (o += ((n ^ r ^ i) + l[5] - 378558) | 0),
          (o = (((o << 4) | (o >>> 28)) + n) | 0),
          (i += ((o ^ n ^ r) + l[8] - 2022574463) | 0),
          (i = (((i << 11) | (i >>> 21)) + o) | 0),
          (r += ((i ^ o ^ n) + l[11] + 1839030562) | 0),
          (r = (((r << 16) | (r >>> 16)) + i) | 0),
          (n += ((r ^ i ^ o) + l[14] - 35309556) | 0),
          (n = (((n << 23) | (n >>> 9)) + r) | 0),
          (o += ((n ^ r ^ i) + l[1] - 1530992060) | 0),
          (o = (((o << 4) | (o >>> 28)) + n) | 0),
          (i += ((o ^ n ^ r) + l[4] + 1272893353) | 0),
          (i = (((i << 11) | (i >>> 21)) + o) | 0),
          (r += ((i ^ o ^ n) + l[7] - 155497632) | 0),
          (r = (((r << 16) | (r >>> 16)) + i) | 0),
          (n += ((r ^ i ^ o) + l[10] - 1094730640) | 0),
          (n = (((n << 23) | (n >>> 9)) + r) | 0),
          (o += ((n ^ r ^ i) + l[13] + 681279174) | 0),
          (o = (((o << 4) | (o >>> 28)) + n) | 0),
          (i += ((o ^ n ^ r) + l[0] - 358537222) | 0),
          (i = (((i << 11) | (i >>> 21)) + o) | 0),
          (r += ((i ^ o ^ n) + l[3] - 722521979) | 0),
          (r = (((r << 16) | (r >>> 16)) + i) | 0),
          (n += ((r ^ i ^ o) + l[6] + 76029189) | 0),
          (n = (((n << 23) | (n >>> 9)) + r) | 0),
          (o += ((n ^ r ^ i) + l[9] - 640364487) | 0),
          (o = (((o << 4) | (o >>> 28)) + n) | 0),
          (i += ((o ^ n ^ r) + l[12] - 421815835) | 0),
          (i = (((i << 11) | (i >>> 21)) + o) | 0),
          (r += ((i ^ o ^ n) + l[15] + 530742520) | 0),
          (r = (((r << 16) | (r >>> 16)) + i) | 0),
          (n += ((r ^ i ^ o) + l[2] - 995338651) | 0),
          (n = (((n << 23) | (n >>> 9)) + r) | 0),
          (o += ((r ^ (n | ~i)) + l[0] - 198630844) | 0),
          (o = (((o << 6) | (o >>> 26)) + n) | 0),
          (i += ((n ^ (o | ~r)) + l[7] + 1126891415) | 0),
          (i = (((i << 10) | (i >>> 22)) + o) | 0),
          (r += ((o ^ (i | ~n)) + l[14] - 1416354905) | 0),
          (r = (((r << 15) | (r >>> 17)) + i) | 0),
          (n += ((i ^ (r | ~o)) + l[5] - 57434055) | 0),
          (n = (((n << 21) | (n >>> 11)) + r) | 0),
          (o += ((r ^ (n | ~i)) + l[12] + 1700485571) | 0),
          (o = (((o << 6) | (o >>> 26)) + n) | 0),
          (i += ((n ^ (o | ~r)) + l[3] - 1894986606) | 0),
          (i = (((i << 10) | (i >>> 22)) + o) | 0),
          (r += ((o ^ (i | ~n)) + l[10] - 1051523) | 0),
          (r = (((r << 15) | (r >>> 17)) + i) | 0),
          (n += ((i ^ (r | ~o)) + l[1] - 2054922799) | 0),
          (n = (((n << 21) | (n >>> 11)) + r) | 0),
          (o += ((r ^ (n | ~i)) + l[8] + 1873313359) | 0),
          (o = (((o << 6) | (o >>> 26)) + n) | 0),
          (i += ((n ^ (o | ~r)) + l[15] - 30611744) | 0),
          (i = (((i << 10) | (i >>> 22)) + o) | 0),
          (r += ((o ^ (i | ~n)) + l[6] - 1560198380) | 0),
          (r = (((r << 15) | (r >>> 17)) + i) | 0),
          (n += ((i ^ (r | ~o)) + l[13] + 1309151649) | 0),
          (n = (((n << 21) | (n >>> 11)) + r) | 0),
          (o += ((r ^ (n | ~i)) + l[4] - 145523070) | 0),
          (o = (((o << 6) | (o >>> 26)) + n) | 0),
          (i += ((n ^ (o | ~r)) + l[11] - 1120210379) | 0),
          (i = (((i << 10) | (i >>> 22)) + o) | 0),
          (r += ((o ^ (i | ~n)) + l[2] + 718787259) | 0),
          (r = (((r << 15) | (r >>> 17)) + i) | 0),
          (n += ((i ^ (r | ~o)) + l[9] - 343485551) | 0),
          (n = (((n << 21) | (n >>> 11)) + r) | 0),
          (p[0] = (o + p[0]) | 0),
          (p[1] = (n + p[1]) | 0),
          (p[2] = (r + p[2]) | 0),
          (p[3] = (i + p[3]) | 0));
      }
      function k(p) {
        var l = [],
          o;
        for (o = 0; o < 64; o += 4)
          l[o >> 2] =
            p.charCodeAt(o) +
            (p.charCodeAt(o + 1) << 8) +
            (p.charCodeAt(o + 2) << 16) +
            (p.charCodeAt(o + 3) << 24);
        return l;
      }
      function K(p) {
        var l = [],
          o;
        for (o = 0; o < 64; o += 4)
          l[o >> 2] =
            p[o] + (p[o + 1] << 8) + (p[o + 2] << 16) + (p[o + 3] << 24);
        return l;
      }
      function I(p) {
        var l = p.length,
          o = [1732584193, -271733879, -1732584194, 271733878],
          n,
          r,
          i,
          B,
          L,
          H;
        for (n = 64; n <= l; n += 64) M(o, k(p.substring(n - 64, n)));
        for (
          p = p.substring(n - 64),
            r = p.length,
            i = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
            n = 0;
          n < r;
          n += 1
        )
          i[n >> 2] |= p.charCodeAt(n) << (n % 4 << 3);
        if (((i[n >> 2] |= 128 << (n % 4 << 3)), n > 55))
          for (M(o, i), n = 0; n < 16; n += 1) i[n] = 0;
        return (
          (B = l * 8),
          (B = B.toString(16).match(/(.*?)(.{0,8})$/)),
          (L = parseInt(B[2], 16)),
          (H = parseInt(B[1], 16) || 0),
          (i[14] = L),
          (i[15] = H),
          M(o, i),
          o
        );
      }
      function P(p) {
        var l = p.length,
          o = [1732584193, -271733879, -1732584194, 271733878],
          n,
          r,
          i,
          B,
          L,
          H;
        for (n = 64; n <= l; n += 64) M(o, K(p.subarray(n - 64, n)));
        for (
          p = n - 64 < l ? p.subarray(n - 64) : new Uint8Array(0),
            r = p.length,
            i = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
            n = 0;
          n < r;
          n += 1
        )
          i[n >> 2] |= p[n] << (n % 4 << 3);
        if (((i[n >> 2] |= 128 << (n % 4 << 3)), n > 55))
          for (M(o, i), n = 0; n < 16; n += 1) i[n] = 0;
        return (
          (B = l * 8),
          (B = B.toString(16).match(/(.*?)(.{0,8})$/)),
          (L = parseInt(B[2], 16)),
          (H = parseInt(B[1], 16) || 0),
          (i[14] = L),
          (i[15] = H),
          M(o, i),
          o
        );
      }
      function V(p) {
        var l = "",
          o;
        for (o = 0; o < 4; o += 1)
          l += R[(p >> (o * 8 + 4)) & 15] + R[(p >> (o * 8)) & 15];
        return l;
      }
      function Q(p) {
        var l;
        for (l = 0; l < p.length; l += 1) p[l] = V(p[l]);
        return p.join("");
      }
      (Q(I("hello")),
        typeof ArrayBuffer < "u" &&
          !ArrayBuffer.prototype.slice &&
          (function () {
            function p(l, o) {
              return (
                (l = l | 0 || 0),
                l < 0 ? Math.max(l + o, 0) : Math.min(l, o)
              );
            }
            ArrayBuffer.prototype.slice = function (l, o) {
              var n = this.byteLength,
                r = p(l, n),
                i = n,
                B,
                L,
                H,
                ne;
              return (
                o !== $ && (i = p(o, n)),
                r > i
                  ? new ArrayBuffer(0)
                  : ((B = i - r),
                    (L = new ArrayBuffer(B)),
                    (H = new Uint8Array(L)),
                    (ne = new Uint8Array(this, r, B)),
                    H.set(ne),
                    L)
              );
            };
          })());
      function E(p) {
        return (
          /[\u0080-\uFFFF]/.test(p) && (p = unescape(encodeURIComponent(p))),
          p
        );
      }
      function D(p, l) {
        var o = p.length,
          n = new ArrayBuffer(o),
          r = new Uint8Array(n),
          i;
        for (i = 0; i < o; i += 1) r[i] = p.charCodeAt(i);
        return l ? r : n;
      }
      function X(p) {
        return String.fromCharCode.apply(null, new Uint8Array(p));
      }
      function q(p, l, o) {
        var n = new Uint8Array(p.byteLength + l.byteLength);
        return (
          n.set(new Uint8Array(p)),
          n.set(new Uint8Array(l), p.byteLength),
          o ? n : n.buffer
        );
      }
      function te(p) {
        var l = [],
          o = p.length,
          n;
        for (n = 0; n < o - 1; n += 2) l.push(parseInt(p.substr(n, 2), 16));
        return String.fromCharCode.apply(String, l);
      }
      function T() {
        this.reset();
      }
      return (
        (T.prototype.append = function (p) {
          return (this.appendBinary(E(p)), this);
        }),
        (T.prototype.appendBinary = function (p) {
          ((this._buff += p), (this._length += p.length));
          var l = this._buff.length,
            o;
          for (o = 64; o <= l; o += 64)
            M(this._hash, k(this._buff.substring(o - 64, o)));
          return ((this._buff = this._buff.substring(o - 64)), this);
        }),
        (T.prototype.end = function (p) {
          var l = this._buff,
            o = l.length,
            n,
            r = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
            i;
          for (n = 0; n < o; n += 1)
            r[n >> 2] |= l.charCodeAt(n) << (n % 4 << 3);
          return (
            this._finish(r, o),
            (i = Q(this._hash)),
            p && (i = te(i)),
            this.reset(),
            i
          );
        }),
        (T.prototype.reset = function () {
          return (
            (this._buff = ""),
            (this._length = 0),
            (this._hash = [1732584193, -271733879, -1732584194, 271733878]),
            this
          );
        }),
        (T.prototype.getState = function () {
          return {
            buff: this._buff,
            length: this._length,
            hash: this._hash.slice(),
          };
        }),
        (T.prototype.setState = function (p) {
          return (
            (this._buff = p.buff),
            (this._length = p.length),
            (this._hash = p.hash),
            this
          );
        }),
        (T.prototype.destroy = function () {
          (delete this._hash, delete this._buff, delete this._length);
        }),
        (T.prototype._finish = function (p, l) {
          var o = l,
            n,
            r,
            i;
          if (((p[o >> 2] |= 128 << (o % 4 << 3)), o > 55))
            for (M(this._hash, p), o = 0; o < 16; o += 1) p[o] = 0;
          ((n = this._length * 8),
            (n = n.toString(16).match(/(.*?)(.{0,8})$/)),
            (r = parseInt(n[2], 16)),
            (i = parseInt(n[1], 16) || 0),
            (p[14] = r),
            (p[15] = i),
            M(this._hash, p));
        }),
        (T.hash = function (p, l) {
          return T.hashBinary(E(p), l);
        }),
        (T.hashBinary = function (p, l) {
          var o = I(p),
            n = Q(o);
          return l ? te(n) : n;
        }),
        (T.ArrayBuffer = function () {
          this.reset();
        }),
        (T.ArrayBuffer.prototype.append = function (p) {
          var l = q(this._buff.buffer, p, !0),
            o = l.length,
            n;
          for (this._length += p.byteLength, n = 64; n <= o; n += 64)
            M(this._hash, K(l.subarray(n - 64, n)));
          return (
            (this._buff =
              n - 64 < o
                ? new Uint8Array(l.buffer.slice(n - 64))
                : new Uint8Array(0)),
            this
          );
        }),
        (T.ArrayBuffer.prototype.end = function (p) {
          var l = this._buff,
            o = l.length,
            n = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
            r,
            i;
          for (r = 0; r < o; r += 1) n[r >> 2] |= l[r] << (r % 4 << 3);
          return (
            this._finish(n, o),
            (i = Q(this._hash)),
            p && (i = te(i)),
            this.reset(),
            i
          );
        }),
        (T.ArrayBuffer.prototype.reset = function () {
          return (
            (this._buff = new Uint8Array(0)),
            (this._length = 0),
            (this._hash = [1732584193, -271733879, -1732584194, 271733878]),
            this
          );
        }),
        (T.ArrayBuffer.prototype.getState = function () {
          var p = T.prototype.getState.call(this);
          return ((p.buff = X(p.buff)), p);
        }),
        (T.ArrayBuffer.prototype.setState = function (p) {
          return ((p.buff = D(p.buff, !0)), T.prototype.setState.call(this, p));
        }),
        (T.ArrayBuffer.prototype.destroy = T.prototype.destroy),
        (T.ArrayBuffer.prototype._finish = T.prototype._finish),
        (T.ArrayBuffer.hash = function (p, l) {
          var o = P(new Uint8Array(p)),
            n = Q(o);
          return l ? te(n) : n;
        }),
        T
      );
    });
  })(Xe);
  var Tt = Xe.exports;
  const Ft = Dt(Tt),
    Je = "3.7.8",
    kt = Je,
    ge = typeof Buffer == "function",
    Ke = typeof TextDecoder == "function" ? new TextDecoder() : void 0,
    Ge = typeof TextEncoder == "function" ? new TextEncoder() : void 0,
    Ut = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
    we = Array.prototype.slice.call(Ut),
    Be = ((d) => {
      let C = {};
      return (d.forEach(($, R) => (C[$] = R)), C);
    })(we),
    Lt =
      /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,
    re = String.fromCharCode.bind(String),
    Qe =
      typeof Uint8Array.from == "function"
        ? Uint8Array.from.bind(Uint8Array)
        : (d) => new Uint8Array(Array.prototype.slice.call(d, 0)),
    Ze = (d) =>
      d.replace(/=/g, "").replace(/[+\/]/g, (C) => (C == "+" ? "-" : "_")),
    et = (d) => d.replace(/[^A-Za-z0-9\+\/]/g, ""),
    tt = (d) => {
      let C,
        $,
        R,
        M,
        k = "";
      const K = d.length % 3;
      for (let I = 0; I < d.length; ) {
        if (
          ($ = d.charCodeAt(I++)) > 255 ||
          (R = d.charCodeAt(I++)) > 255 ||
          (M = d.charCodeAt(I++)) > 255
        )
          throw new TypeError("invalid character found");
        ((C = ($ << 16) | (R << 8) | M),
          (k +=
            we[(C >> 18) & 63] +
            we[(C >> 12) & 63] +
            we[(C >> 6) & 63] +
            we[C & 63]));
      }
      return K ? k.slice(0, K - 3) + "===".substring(K) : k;
    },
    Le =
      typeof btoa == "function"
        ? (d) => btoa(d)
        : ge
          ? (d) => Buffer.from(d, "binary").toString("base64")
          : tt,
    Pe = ge
      ? (d) => Buffer.from(d).toString("base64")
      : (d) => {
          let $ = [];
          for (let R = 0, M = d.length; R < M; R += 4096)
            $.push(re.apply(null, d.subarray(R, R + 4096)));
          return Le($.join(""));
        },
    Re = (d, C = !1) => (C ? Ze(Pe(d)) : Pe(d)),
    Pt = (d) => {
      if (d.length < 2) {
        var C = d.charCodeAt(0);
        return C < 128
          ? d
          : C < 2048
            ? re(192 | (C >>> 6)) + re(128 | (C & 63))
            : re(224 | ((C >>> 12) & 15)) +
              re(128 | ((C >>> 6) & 63)) +
              re(128 | (C & 63));
      } else {
        var C =
          65536 + (d.charCodeAt(0) - 55296) * 1024 + (d.charCodeAt(1) - 56320);
        return (
          re(240 | ((C >>> 18) & 7)) +
          re(128 | ((C >>> 12) & 63)) +
          re(128 | ((C >>> 6) & 63)) +
          re(128 | (C & 63))
        );
      }
    },
    Ot = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,
    nt = (d) => d.replace(Ot, Pt),
    rt = ge
      ? (d) => Buffer.from(d, "utf8").toString("base64")
      : Ge
        ? (d) => Pe(Ge.encode(d))
        : (d) => Le(nt(d)),
    ye = (d, C = !1) => (C ? Ze(rt(d)) : rt(d)),
    ot = (d) => ye(d, !0),
    $t =
      /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,
    Mt = (d) => {
      switch (d.length) {
        case 4:
          var C =
              ((7 & d.charCodeAt(0)) << 18) |
              ((63 & d.charCodeAt(1)) << 12) |
              ((63 & d.charCodeAt(2)) << 6) |
              (63 & d.charCodeAt(3)),
            $ = C - 65536;
          return re(($ >>> 10) + 55296) + re(($ & 1023) + 56320);
        case 3:
          return re(
            ((15 & d.charCodeAt(0)) << 12) |
              ((63 & d.charCodeAt(1)) << 6) |
              (63 & d.charCodeAt(2)),
          );
        default:
          return re(((31 & d.charCodeAt(0)) << 6) | (63 & d.charCodeAt(1)));
      }
    },
    at = (d) => d.replace($t, Mt),
    it = (d) => {
      if (((d = d.replace(/\s+/g, "")), !Lt.test(d)))
        throw new TypeError("malformed base64.");
      d += "==".slice(2 - (d.length & 3));
      let C,
        $,
        R,
        M = [];
      for (let k = 0; k < d.length; )
        ((C =
          (Be[d.charAt(k++)] << 18) |
          (Be[d.charAt(k++)] << 12) |
          (($ = Be[d.charAt(k++)]) << 6) |
          (R = Be[d.charAt(k++)])),
          $ === 64
            ? M.push(re((C >> 16) & 255))
            : R === 64
              ? M.push(re((C >> 16) & 255, (C >> 8) & 255))
              : M.push(re((C >> 16) & 255, (C >> 8) & 255, C & 255)));
      return M.join("");
    },
    Oe =
      typeof atob == "function"
        ? (d) => atob(et(d))
        : ge
          ? (d) => Buffer.from(d, "base64").toString("binary")
          : it,
    st = ge
      ? (d) => Qe(Buffer.from(d, "base64"))
      : (d) =>
          Qe(
            Oe(d)
              .split("")
              .map((C) => C.charCodeAt(0)),
          ),
    ut = (d) => st(ct(d)),
    Vt = ge
      ? (d) => Buffer.from(d, "base64").toString("utf8")
      : Ke
        ? (d) => Ke.decode(st(d))
        : (d) => at(Oe(d)),
    ct = (d) => et(d.replace(/[-_]/g, (C) => (C == "-" ? "+" : "/"))),
    $e = (d) => Vt(ct(d)),
    jt = (d) => {
      if (typeof d != "string") return !1;
      const C = d.replace(/\s+/g, "").replace(/={0,2}$/, "");
      return !/[^\s0-9a-zA-Z\+/]/.test(C) || !/[^\s0-9a-zA-Z\-_]/.test(C);
    },
    lt = (d) => ({ value: d, enumerable: !1, writable: !0, configurable: !0 }),
    ft = function () {
      const d = (C, $) => Object.defineProperty(String.prototype, C, lt($));
      (d("fromBase64", function () {
        return $e(this);
      }),
        d("toBase64", function (C) {
          return ye(this, C);
        }),
        d("toBase64URI", function () {
          return ye(this, !0);
        }),
        d("toBase64URL", function () {
          return ye(this, !0);
        }),
        d("toUint8Array", function () {
          return ut(this);
        }));
    },
    dt = function () {
      const d = (C, $) => Object.defineProperty(Uint8Array.prototype, C, lt($));
      (d("toBase64", function (C) {
        return Re(this, C);
      }),
        d("toBase64URI", function () {
          return Re(this, !0);
        }),
        d("toBase64URL", function () {
          return Re(this, !0);
        }));
    },
    zt = {
      version: Je,
      VERSION: kt,
      atob: Oe,
      atobPolyfill: it,
      btoa: Le,
      btoaPolyfill: tt,
      fromBase64: $e,
      toBase64: ye,
      encode: ye,
      encodeURI: ot,
      encodeURL: ot,
      utob: nt,
      btou: at,
      decode: $e,
      isValid: jt,
      fromUint8Array: Re,
      toUint8Array: ut,
      extendString: ft,
      extendUint8Array: dt,
      extendBuiltins: () => {
        (ft(), dt());
      },
    },
    Yt = { class: "xde-uploader-container" },
    Wt = { key: 0 },
    qt = { class: "upload-controls" },
    Ht = { key: 0, class: "upload-hint" },
    Xt = { class: "file-header" },
    Jt = { class: "file-info" },
    Kt = { class: "file-meta" },
    Gt = { class: "file-name" },
    Qt = { class: "file-actions" },
    Zt = ["onClick"],
    en = ["onClick"],
    tn = ["onClick"],
    nn = { key: 0, class: "upload-progress" },
    rn = { class: "progress-header" },
    on = { class: "status-text" },
    an = { key: 1, class: "file-status" },
    sn = { key: 0, class: "upload-progress" },
    un = { class: "progress-header" },
    cn = { class: "status-text" },
    ln = "/uap/docCenter/preSignedUrls",
    fn = "/uap/docCenter/preSignedUrl",
    dn = "/uap/docCenter/uploadToLocalDisk",
    hn = "/uap/docCenter/downloadFromLocalDisk",
    pn = "/uap/docCenter/downloadFromLocalDiskByDocId",
    mn = "/uap/docCenter/preview",
    vn = "/uap/docCenter/fileServerPath",
    gn = "/mvr/vtk/importModel",
    yn = "/mvr/vtk/getProjectIdByFilePath",
    bn = "/uap/docCenter/objectExists",
    _n = "/uap/docCenter/mergeChunks",
    wn = m.defineComponent({
      name: "XdeFileUploader",
      __name: "index",
      props: {
        bucketConfig: {},
        uploadToFileServer: { type: Boolean, default: !0 },
        accept: { default: "" },
        limit: {},
        maxHeight: { default: 300 },
        maxSize: { default: -1 },
        hintText: { default: "" },
        buttonText: { default: "选择文件" },
        multiple: { type: Boolean, default: !0 },
        chunkSize: { default: 10 * 1024 * 1024 },
        uploadedFiles: { default: () => [] },
        asyncUpload: { type: Boolean, default: !0 },
        showFileList: { type: Boolean, default: !0 },
        showProcessDialog: { type: Boolean, default: !0 },
        disabledUpload: { type: Boolean, default: !1 },
        uploadFolder: { type: Boolean, default: !1 },
        ifUpload: { type: Boolean, default: !0 },
        filePreview: { type: Boolean, default: !1 },
        docHandler: { default: "" },
      },
      emits: ["fileList-change", "upload-complete"],
      setup(d, { expose: C, emit: $ }) {
        const R = d,
          M = $,
          { proxy: k } = m.getCurrentInstance(),
          K = m.ref(null);
        m.ref([]);
        const I = m.ref({}),
          P = m.ref([]),
          V = m.ref([]),
          Q = m.ref([]),
          E = m.ref([]),
          D = m.ref(!1),
          X = m.computed(() =>
            typeof R.limit == "number" && R.limit >= 0 ? R.limit : null,
          ),
          q = m.computed(() => [
            ...V.value.filter((f) => !f.__deleted),
            ...P.value,
          ]),
          te = m.computed(() => R.showProcessDialog && D.value);
        (m.watch(
          () => R.uploadedFiles,
          (f) => {
            const w = new Set(
                V.value.filter((g) => g.__deleted).map((g) => g.uid),
              ),
              S = new Set(V.value.map((g) => g.uid)),
              x = l(f || [], S, w);
            V.value = [...x];
          },
          { immediate: !0, deep: !0 },
        ),
          m.watch(
            () => R.uploadFolder,
            (f) => {
              m.nextTick(() => {
                var S;
                const w = (S = K.value) == null ? void 0 : S.$el;
                if (w) {
                  const x = w.querySelector('input[type="file"]');
                  x && (x.webkitdirectory = f);
                }
              });
            },
            { immediate: !0 },
          ));
        const T = async (f) => {
            if (P.value.filter((S) => S.status === "ready").length === 0) {
              ve.ElMessage.warning("没有需要上传的文件");
              return;
            }
            (await ie(f), await pe(f));
          },
          p = () => {
            ((P.value = []), (V.value = []));
          };
        function l(f, w, S) {
          return f
            .filter((x) => !w.has(x.uid) && !S.has(x.uid))
            .map((x) => ({
              ...x,
              __static: !0,
              uid: x.uid || o(),
              status: x.status || "success",
              percentage: x.percentage || 100,
              size: x.size || 0,
              __deleted: !1,
            }));
        }
        const o = () =>
            Date.now().toString(36) + Math.random().toString(36).substr(2),
          n = async (f) =>
            new Promise(async (w) => {
              var F, U, J;
              const S =
                  (F = I == null ? void 0 : I.value[f.uid]) == null
                    ? void 0
                    : F.chunkConfig.fileMd5,
                x = Ee(f.raw),
                g = {
                  bucketName:
                    (U = I == null ? void 0 : I.value[f.uid]) == null
                      ? void 0
                      : U.config.bucketName,
                  objectName:
                    (J = I == null ? void 0 : I.value[f.uid]) == null
                      ? void 0
                      : J.config.objectName,
                },
                A = x.map((oe, G) => ({
                  ...g,
                  action: "upload",
                  objectName: `${S}/${g != null && g.objectName.includes(".") ? g.objectName.substring(0, g.objectName.lastIndexOf(".")) : g == null ? void 0 : g.objectName}/${G}`,
                })),
                j = {
                  fileMd5: S,
                  totalChunks: xe(f),
                  uploadedChunks: [],
                  chunksStatus: A.map((oe) => ({ ...oe, uploadStatus: !1 })),
                };
              let z = S + "/" + f.name.substring(0, f.name.lastIndexOf("."));
              (!localStorage.getItem(z) &&
                localStorage.setItem(z, JSON.stringify(j)),
                w(j.chunksStatus));
            }),
          r = async (f) =>
            new Promise(async (w) => {
              var j, z, F;
              const S =
                  (j = I == null ? void 0 : I.value[f.uid]) == null
                    ? void 0
                    : j.chunkConfig.fileMd5,
                x = Ee(f.raw),
                g = {
                  bucketName:
                    (z = I == null ? void 0 : I.value[f.uid]) == null
                      ? void 0
                      : z.config.bucketName,
                  objectName:
                    (F = I == null ? void 0 : I.value[f.uid]) == null
                      ? void 0
                      : F.config.objectName,
                },
                A = x.map((U, J) => ({
                  ...g,
                  action: "upload",
                  objectName: `${S}/${g != null && g.objectName.includes(".") ? g.objectName.substring(0, g.objectName.lastIndexOf(".")) : g == null ? void 0 : g.objectName}/${J}`,
                }));
              if (k.$request)
                try {
                  const U = await k.$request({
                      url: ln,
                      method: "post",
                      data: A,
                    }),
                    J = {
                      fileMd5: S,
                      totalChunks: xe(f),
                      uploadedChunks: [],
                      chunksStatus: A.map((G, fe) => ({
                        ...G,
                        presignedUrl: U[fe],
                        uploadStatus: !1,
                      })),
                    };
                  let oe =
                    S + "/" + f.name.substring(0, f.name.lastIndexOf("."));
                  (!localStorage.getItem(oe) &&
                    localStorage.setItem(oe, JSON.stringify(J)),
                    w(J.chunksStatus));
                } catch (U) {
                  (console.error(U), this.$message.error("获取上传授权失败"));
                }
            }),
          i = (f) =>
            f
              ? f < 1024
                ? f + " Bytes"
                : f < 1024 * 1024
                  ? (f / 1024).toFixed(1) + " KB"
                  : f < 1024 * 1024 * 1024
                    ? (f / (1024 * 1024)).toFixed(1) + " MB"
                    : (f / (1024 * 1024 * 1024)).toFixed(1) + " GB"
              : "0 Bytes",
          B = (f) => {
            const w = f.name.split(".").pop().toLowerCase();
            return ["jpg", "jpeg", "png", "gif", "bmp", "svg"].includes(w)
              ? "el-icon-picture"
              : "el-icon-document";
          },
          L = (f) => {
            switch (f.status) {
              case "ready":
                return "等待上传";
              case "uploading":
                return `上传中 ${f.percentage}%`;
              case "success":
                return "上传成功";
              case "fail":
                return "上传失败";
              default:
                return f.status;
            }
          },
          H = async (f, w) => {
            M("fileList-change", f, w, (S) => {
              ((P.value = w
                .filter((x) => !x.__static)
                .filter((x) => {
                  if (R.accept) {
                    const g = R.accept.split(","),
                      A = x.type || "",
                      j = x.name.split(".").pop().toLowerCase();
                    if (
                      !g.some(
                        (F) => (
                          (F = F.trim().toLowerCase()),
                          F === A || j === F.replace(".", "") || F === `.${j}`
                        ),
                      )
                    )
                      return !1;
                  }
                  return !0;
                })
                .map((x) => (f.uid === x.uid ? { ...x, ...S } : x))),
                f.status === "ready" &&
                  (I.value[f.uid] = {
                    xhr: null,
                    config: {
                      ...S,
                      uid: f.uid,
                      fileName: f.name,
                      totalSize: f.size,
                    },
                  }));
            });
          },
          ne = (f) => {
            var g;
            let w = !0;
            const S = P.value.findIndex((A) => A.uid === f.uid);
            if (S !== -1) P.value.splice(S, 1);
            else {
              const A = V.value.findIndex((j) => j.uid === f.uid);
              A !== -1 &&
                (V.value[A].__static
                  ? (V.value[A].__deleted = !0)
                  : V.value.splice(A, 1),
                (w = !1));
            }
            const x = I.value[f.uid];
            if (
              (w &&
                f.status === "uploading" &&
                x &&
                ((g = x.xhr) == null || g.abort()),
              w && x)
            ) {
              const A = x.configIndex;
              A !== void 0 && (E.value[A] = !1);
            }
            (x && delete I.value[f.uid],
              (Q.value = Q.value.filter((A) => A.uid !== f.uid)),
              ae());
          },
          ae = () => {
            const f = q.value.filter((A) => !A.__deleted),
              w = f.filter((A) => A.status === "success" && !A.__static),
              S = f.filter((A) => A.status === "fail" && !A.__static),
              x = [
                ...Q.value,
                ...V.value
                  .filter((A) => A.__static && !A.__deleted)
                  .map((A) => ({
                    uid: A.uid,
                    bucketName: A.bucketName || "",
                    objectName: A.objectName || "",
                    fileName: A.name,
                    isExisting: !0,
                  })),
              ],
              g = {
                successFiles: w,
                failedFiles: S,
                total: f.length,
                filesConfig: x,
                allFiles: f,
              };
            M("upload-complete", g);
          },
          ie = (f) => {
            if (R.accept) {
              const w = R.accept.split(","),
                S = f.type || "",
                x = f.name.split(".").pop().toLowerCase(),
                g = w.some(
                  (A) => (
                    (A = A.trim().toLowerCase()),
                    A === S || x === A.replace(".", "") || A === `.${x}`
                  ),
                );
              if (R.uploadFolder && !g) return !1;
              if (!g)
                return (
                  this.$message.error(
                    `不支持的文件类型: ${f.name}，只支持 ${R.accept} 格式`,
                  ),
                  !1
                );
            }
            return R.maxSize !== -1 && f.size > R.maxSize
              ? (this.$message.error(
                  `文件大小超出限制: ${f.name} (最大允许 ${i(R.maxSize)})`,
                ),
                !1)
              : ((f.percentage = 0),
                new Promise(async (w) => {
                  try {
                    console.log("文件配置:", f, I.value);
                    const S = f.uid;
                    if (!I.value[S].chunkConfig) {
                      const x = await Te(f.raw);
                      let g =
                        x + "/" + f.name.substring(0, f.name.lastIndexOf("."));
                      const A = localStorage.getItem(g)
                        ? JSON.parse(localStorage.getItem(g))
                        : void 0;
                      I.value[S].chunkConfig = A || {
                        fileMd5: x,
                        totalChunks: xe(f),
                        uploadedChunks: [],
                      };
                    }
                    w(!0);
                  } catch (S) {
                    console.log(S, "错误2");
                  }
                }));
          },
          ue = (f) => {},
          pe = async (f) => {
            try {
              const w = I.value[f.uid],
                S = await le(w),
                x = Ee(f.raw).map((F, U) => ({ chunkIndex: U, chunkBolb: F }));
              let g = [];
              if (S.exists === !0) {
                ((f.status = "success"),
                  (f.docId = S.docId),
                  (P.value = P.value.map((F) => ({
                    ...F,
                    docId: S.docId,
                    status: F.uid === f.uid ? "success" : F.status,
                  }))),
                  ce());
                return;
              } else if (
                w.chunkConfig.uploadedChunks &&
                w.chunkConfig.uploadedChunks.length
              )
                g = x.filter(
                  (F, U) => !w.chunkConfig.uploadedChunks.includes(U),
                );
              else {
                if (R.uploadToFileServer) {
                  const F = await r(f);
                  I.value[f.uid].chunkConfig.chunksStatus = F;
                } else {
                  const F = await n(f);
                  I.value[f.uid].chunkConfig.chunksStatus = F;
                }
                g = x;
              }
              D.value = !0;
              const A = new Array(g.length).fill(0),
                j = P.value.find((F) => F.uid === w.config.uid);
              j && (j.chunkProgress = A);
              let z = [];
              for (let F = 0; F < g.length; F++)
                try {
                  R.uploadToFileServer
                    ? z.push(Se(g[F].chunkBolb, w, g[F].chunkIndex, F, A))
                    : z.push(
                        be(g[F].chunkBolb, w, g[F].chunkIndex, F, A, g.length),
                      );
                } catch {
                  break;
                }
              Promise.all(z).then((F) => {
                P.value.some(
                  (U) => U.status === "uploading" || U.status === "ready",
                ) || (D.value = !1);
              });
            } catch (w) {
              (console.log("=>(index.vue:661) error", w),
                (f.status = "fail"),
                (P.value = P.value.map((S) => ({
                  ...S,
                  status: S.uid === f.uid ? "fail" : S.status,
                }))));
            }
          },
          be = (f, w, S, x, g, A) => {
            const j = P.value.find((z) => z.uid === w.config.uid);
            return (
              j && (j.status = "uploading"),
              new Promise((z, F) => {
                const U = new FormData();
                (U.append("file", f),
                  k
                    .$request({
                      url:
                        dn +
                        `?bucketName=${w.config.bucketName}&objectName=${w.chunkConfig.chunksStatus[S].objectName}`,
                      method: "post",
                      data: U,
                    })
                    .then(async (J) => {
                      let oe =
                        w.chunkConfig.fileMd5 +
                        "/" +
                        w.config.fileName.substring(
                          0,
                          w.config.fileName.lastIndexOf("."),
                        );
                      const G = localStorage.getItem(oe)
                        ? JSON.parse(localStorage.getItem(oe))
                        : {
                            fileMd5: "",
                            totalChunks: 0,
                            uploadedChunks: [],
                            chunksStatus: [],
                          };
                      ((G.uploadedChunks = G.uploadedChunks.includes(S)
                        ? G.uploadedChunks
                        : [...G.uploadedChunks, S]),
                        (G.chunksStatus = G.chunksStatus.map((fe, me) => ({
                          ...fe,
                          uploadStatus: me === S || fe.uploadStatus,
                        }))),
                        localStorage.setItem(oe, JSON.stringify(G)),
                        j &&
                          (j.percentage = Math.round(
                            (G.uploadedChunks.length / A) * 100,
                          )),
                        G.chunksStatus.length === G.uploadedChunks.length &&
                          (await ke(w, j, G.fileMd5), ce()),
                        z(null));
                    })
                    .catch((J) => {
                      (console.log("=>(index.vue:641) 上传报错", J),
                        (D.value = !1),
                        F(J));
                    }));
              })
            );
          },
          Se = (f, w, S, x, g) =>
            new Promise((A, j) => {
              const z = new XMLHttpRequest();
              ((I.value[w.config.uid].xhr = z),
                z.open("PUT", w.chunkConfig.chunksStatus[S].presignedUrl, !0),
                z.setRequestHeader(
                  "Content-Type",
                  f.type || "application/octet-stream",
                ));
              const F = P.value.find((U) => U.uid === w.config.uid);
              (F && (F.status = "uploading"),
                (z.upload.onprogress = (U) => {
                  if (U.lengthComputable) {
                    const J = Math.round((U.loaded / U.total) * 100);
                    g[x] = J;
                    const oe = g.length,
                      G = g.reduce((me, Ie) => me + Ie, 0),
                      fe = Math.round(G / oe);
                    F && (F.percentage = fe);
                  }
                }),
                (z.onload = async () => {
                  if (z.status >= 200 && z.status < 300) {
                    let U =
                      w.chunkConfig.fileMd5 +
                      "/" +
                      w.config.fileName.substring(
                        0,
                        w.config.fileName.lastIndexOf("."),
                      );
                    const J = localStorage.getItem(U)
                      ? JSON.parse(localStorage.getItem(U))
                      : {
                          fileMd5: "",
                          totalChunks: 0,
                          uploadedChunks: [],
                          chunksStatus: [],
                        };
                    ((J.uploadedChunks = J.uploadedChunks.includes(S)
                      ? J.uploadedChunks
                      : [...J.uploadedChunks, S]),
                      (J.chunksStatus = J.chunksStatus.map((oe, G) => ({
                        ...oe,
                        uploadStatus: G === S || oe.uploadStatus,
                      }))),
                      localStorage.setItem(U, JSON.stringify(J)),
                      J.chunksStatus.length === J.uploadedChunks.length &&
                        (await ke(w, F, J.fileMd5), await ce()),
                      A(null));
                  } else
                    ((F.status = "fail"),
                      (P.value = P.value.map((U) => ({
                        ...U,
                        status: U.uid === w.config.uid ? "fail" : U.status,
                      }))),
                      j("上传失败"));
                }),
                (z.onerror = () => {
                  (F && (F.status = "fail"),
                    (P.value = P.value.map((U) => ({
                      ...U,
                      status: U.uid === w.config.uid ? "fail" : U.status,
                    }))),
                    ce(),
                    j("上传失败"));
                }),
                z.send(f));
            }),
          ce = () => {
            P.value.some(
              (f) => f.status === "uploading" || f.status === "ready",
            ) || ae();
          },
          Te = (f) =>
            new Promise((w) => {
              const S = new FileReader();
              ((S.onload = function (x) {
                const g = new Ft.ArrayBuffer();
                (g.append(x.target.result), w(g.end()));
              }),
                S.readAsArrayBuffer(f));
            }),
          xe = (f) => Math.ceil((f.size || 0) / R.chunkSize),
          Ee = (f) => {
            const w = [];
            if (f.size > R.chunkSize)
              for (let S = 0; S < f.size; S += R.chunkSize)
                w.push(f.slice(S, S + R.chunkSize));
            else w.push(f.slice(0));
            return w;
          },
          le = async (f) =>
            await k.$request({
              url: bn,
              method: "get",
              params: {
                bucketName: f.config.bucketName,
                objectName: `${f.config.objectName}`,
                fileMd5: `${f.chunkConfig.fileMd5}`,
                uploadToFileServer: R.uploadToFileServer,
              },
            }),
          Fe = async (f, w, S) => {
            const x = {
                bucketName: f,
                action: "download",
                objectName: w,
                docId: S,
              },
              g = await k.$request({ url: fn, method: "get", params: x });
            return g || (console.warn("下载请求返回异常数据:", g), null);
          },
          Me = async (f) => {
            if (["stp", "igs", "stl"].includes(f.name.split(".").pop())) {
              const S = await k.$request({
                  url: vn + "?docId=" + f.docId,
                  method: "get",
                }),
                x = await k.$request({
                  url: yn + "?filePath=" + S,
                  method: "get",
                });
              let g = null;
              if (x) g = x;
              else {
                const j = this.$loading({
                    lock: !0,
                    text: "模型首次加载中...",
                  }),
                  z = await k.$request({
                    url: gn,
                    method: "post",
                    data: { filePath: S, name: S.md5 },
                  });
                (j.close(), (g = z.id));
              }
              let A =
                process.env.NODE_ENV === "development"
                  ? "http://127.0.0.1:8081"
                  : "/mvr";
              window.open(
                `${A}/mvrView?projectId=${g}&type=CAD&isProject=null&hasModel=true`,
              );
            } else {
              const S = await k.$request({
                url: mn + "?docId=" + f.docId,
                method: "get",
              });
              let x =
                process.env.NODE_ENV === "development"
                  ? "http://127.0.0.1:8012"
                  : "/kkfile";
              window.open(
                `${x}/onlinePreview?url=` + encodeURIComponent(zt.encode(S)),
              );
            }
          },
          Ve = async (f) => {
            if (R.uploadToFileServer) {
              const w = await Fe(f.bucketName, f.objectName, f.docId),
                S = document.createElement("a");
              ((S.href = w),
                (S.download = f.name || "downloaded-file"),
                document.body.appendChild(S),
                S.click(),
                document.body.removeChild(S));
            } else {
              let w = f.docId ? pn : hn,
                S = f.docId
                  ? { docId: f.docId }
                  : {
                      bucketName:
                        f.bucketName || I.value[f.uid].config.bucketName,
                      objectName:
                        f.objectName || I.value[f.uid].config.objectName,
                    };
              k.$request({
                url: w,
                method: "get",
                params: S,
                responseType: "blob",
              }).then((x) => {
                const g = URL.createObjectURL(x),
                  A = document.createElement("a");
                ((A.href = g),
                  (A.download = f.name || "downloaded-file"),
                  document.body.appendChild(A),
                  A.click(),
                  document.body.removeChild(A),
                  URL.revokeObjectURL(g));
              });
            }
          },
          ke = async (f, w, S) => {
            try {
              const x = await k.$request({
                  url: _n,
                  method: "get",
                  params: {
                    bucketName: f.config.bucketName,
                    fileMd5: f.chunkConfig.fileMd5,
                    objectName: f.config.objectName,
                    totalChunks: f.chunkConfig.totalChunks,
                    uploadToFileServer: R.uploadToFileServer,
                  },
                }),
                g = {
                  uid: w.uid,
                  bucketName: f.config.bucketName,
                  objectName: f.config.objectName,
                  fileName: w.name,
                  isExisting: !1,
                  docId: x ? x.id : "",
                };
              Q.value.push(g);
              let A = S + "/" + w.name.substring(0, w.name.lastIndexOf("."));
              (localStorage.removeItem(A),
                (w.status = "success"),
                (w.docId = x ? x.id : ""));
              const j = P.value.find((z) => z.uid === w.uid);
              j &&
                ((j.docId = x ? x.id : ""),
                (j.businessResult = x ? x.businessResult : ""));
            } catch {
              let g = S + "/" + w.name.substring(0, w.name.lastIndexOf("."));
              localStorage.removeItem(g);
            }
          };
        return (
          C({ startUpload: T, clearFileList: p }),
          (f, w) => {
            const S = m.resolveComponent("el-icon"),
              x = m.resolveComponent("el-tag");
            return (
              m.openBlock(),
              m.createElementBlock("div", Yt, [
                d.ifUpload
                  ? (m.openBlock(),
                    m.createElementBlock("div", Wt, [
                      m.createVNode(
                        m.unref(ve.ElUpload),
                        {
                          ref_key: "uploadRef",
                          ref: K,
                          action: "",
                          "http-request": ue,
                          "file-list": q.value,
                          "on-change": H,
                          "on-remove": ne,
                          multiple: d.multiple,
                          accept: d.accept,
                          limit: X.value,
                          disabled:
                            (X.value && q.value.length === X.value) ||
                            d.disabledUpload,
                          "show-file-list": !1,
                        },
                        {
                          default: m.withCtx(() => [
                            m.createElementVNode("div", qt, [
                              m.renderSlot(
                                f.$slots,
                                "uploadIcon",
                                {},
                                () => [
                                  m.createVNode(
                                    m.unref(ve.ElButton),
                                    {
                                      disabled:
                                        q.value.length === X.value ||
                                        d.disabledUpload,
                                      type: "primary",
                                    },
                                    {
                                      default: m.withCtx(() => [
                                        m.createTextVNode(
                                          m.toDisplayString(d.buttonText),
                                          1,
                                        ),
                                      ]),
                                      _: 1,
                                    },
                                    8,
                                    ["disabled"],
                                  ),
                                ],
                                !0,
                              ),
                            ]),
                          ]),
                          _: 3,
                        },
                        8,
                        [
                          "file-list",
                          "multiple",
                          "accept",
                          "limit",
                          "disabled",
                        ],
                      ),
                      d.hintText
                        ? (m.openBlock(),
                          m.createElementBlock(
                            "div",
                            Ht,
                            m.toDisplayString(d.hintText),
                            1,
                          ))
                        : m.createCommentVNode("", !0),
                    ]))
                  : m.createCommentVNode("", !0),
                d.showFileList
                  ? (m.openBlock(),
                    m.createElementBlock(
                      "div",
                      {
                        key: 1,
                        class: "file-list-container",
                        style: m.normalizeStyle({
                          "max-height": d.maxHeight + "px",
                        }),
                      },
                      [
                        (m.openBlock(!0),
                        m.createElementBlock(
                          m.Fragment,
                          null,
                          m.renderList(
                            q.value,
                            (g) => (
                              m.openBlock(),
                              m.createElementBlock(
                                "div",
                                { key: g.uid, class: "file-item" },
                                [
                                  m.createElementVNode("div", Xt, [
                                    m.createElementVNode("div", Jt, [
                                      m.createVNode(
                                        S,
                                        {
                                          class: m.normalizeClass([
                                            "file-icon",
                                            B(g),
                                          ]),
                                        },
                                        null,
                                        8,
                                        ["class"],
                                      ),
                                      m.createElementVNode("div", Kt, [
                                        m.createElementVNode(
                                          "div",
                                          Gt,
                                          m.toDisplayString(g.name),
                                          1,
                                        ),
                                      ]),
                                    ]),
                                    m.createElementVNode("div", Qt, [
                                      d.filePreview
                                        ? (m.openBlock(),
                                          m.createElementBlock(
                                            "i",
                                            {
                                              key: 0,
                                              class:
                                                "el-icon-zoom-in preview-icon",
                                              onClick: (A) => Me(g),
                                            },
                                            null,
                                            8,
                                            Zt,
                                          ))
                                        : m.createCommentVNode("", !0),
                                      m.createElementVNode(
                                        "i",
                                        {
                                          class:
                                            "el-icon-download download-icon download-style",
                                          onClick: (A) => Ve(g),
                                        },
                                        null,
                                        8,
                                        en,
                                      ),
                                      d.ifUpload
                                        ? (m.openBlock(),
                                          m.createElementBlock(
                                            "i",
                                            {
                                              key: 1,
                                              class:
                                                "el-icon-delete remove-icon",
                                              onClick: (A) => ne(g),
                                            },
                                            null,
                                            8,
                                            tn,
                                          ))
                                        : m.createCommentVNode("", !0),
                                    ]),
                                  ]),
                                  g.status === "uploading"
                                    ? (m.openBlock(),
                                      m.createElementBlock("div", nn, [
                                        m.createElementVNode("div", rn, [
                                          m.createElementVNode(
                                            "span",
                                            on,
                                            m.toDisplayString(L(g)),
                                            1,
                                          ),
                                        ]),
                                        m.createVNode(
                                          m.unref(ve.ElProgress),
                                          {
                                            "text-inside": !1,
                                            "stroke-width": 2,
                                            percentage: g.percentage || 0,
                                            color: "#1664B5",
                                          },
                                          null,
                                          8,
                                          ["percentage"],
                                        ),
                                      ]))
                                    : (m.openBlock(),
                                      m.createElementBlock("div", an, [
                                        m.createVNode(
                                          x,
                                          {
                                            type:
                                              g.status === "success"
                                                ? "success"
                                                : "info",
                                            effect: "plain",
                                            size: "small",
                                          },
                                          {
                                            default: m.withCtx(() => [
                                              m.createElementVNode(
                                                "i",
                                                {
                                                  class: m.normalizeClass(
                                                    g.status === "success"
                                                      ? "el-icon-check"
                                                      : "",
                                                  ),
                                                },
                                                null,
                                                2,
                                              ),
                                              m.createTextVNode(
                                                " " + m.toDisplayString(L(g)),
                                                1,
                                              ),
                                            ]),
                                            _: 2,
                                          },
                                          1032,
                                          ["type"],
                                        ),
                                      ])),
                                ],
                              )
                            ),
                          ),
                          128,
                        )),
                      ],
                      4,
                    ))
                  : m.createCommentVNode("", !0),
                m.createVNode(
                  m.unref(ve.ElDialog),
                  {
                    modelValue: te.value,
                    "onUpdate:modelValue":
                      w[0] || (w[0] = (g) => (te.value = g)),
                    "show-close": !1,
                    "close-on-press-escape": !1,
                    "close-on-click-modal": !1,
                    width: "400px",
                    title: "文件上传进度",
                    "append-to-body": "",
                  },
                  {
                    default: m.withCtx(() => [
                      (m.openBlock(!0),
                      m.createElementBlock(
                        m.Fragment,
                        null,
                        m.renderList(
                          q.value,
                          (g) => (
                            m.openBlock(),
                            m.createElementBlock(
                              "div",
                              { key: g.uid, class: "file-item" },
                              [
                                g.status === "uploading"
                                  ? (m.openBlock(),
                                    m.createElementBlock("div", sn, [
                                      m.createElementVNode("div", un, [
                                        m.createElementVNode(
                                          "span",
                                          cn,
                                          m.toDisplayString(g.name + L(g)),
                                          1,
                                        ),
                                      ]),
                                      m.createVNode(
                                        m.unref(ve.ElProgress),
                                        {
                                          "text-inside": !0,
                                          "stroke-width": 20,
                                          percentage: g.percentage || 0,
                                          status:
                                            g.percentage === 100
                                              ? "success"
                                              : "warning",
                                        },
                                        null,
                                        8,
                                        ["percentage", "status"],
                                      ),
                                    ]))
                                  : m.createCommentVNode("", !0),
                              ],
                            )
                          ),
                        ),
                        128,
                      )),
                    ]),
                    _: 1,
                  },
                  8,
                  ["modelValue"],
                ),
              ])
            );
          }
        );
      },
    }),
    cr = "",
    lr = "",
    Sn = ((d, C) => {
      const $ = d.__vccOpts || d;
      for (const [R, M] of C) $[R] = M;
      return $;
    })(wn, [["__scopeId", "data-v-9703c687"]]);
  function De(d) {
    throw new Error(
      'Could not dynamically require "' +
        d +
        '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.',
    );
  }
  var xn = { exports: {} };
  /*!
    localForage -- Offline Storage, Improved
    Version 1.10.0
    https://localforage.github.io/localForage
    (c) 2013-2017 Mozilla, Apache License 2.0
*/ ((function (d, C) {
    (function ($) {
      d.exports = $();
    })(function () {
      return (function $(R, M, k) {
        function K(V, Q) {
          if (!M[V]) {
            if (!R[V]) {
              var E = typeof De == "function" && De;
              if (!Q && E) return E(V, !0);
              if (I) return I(V, !0);
              var D = new Error("Cannot find module '" + V + "'");
              throw ((D.code = "MODULE_NOT_FOUND"), D);
            }
            var X = (M[V] = { exports: {} });
            R[V][0].call(
              X.exports,
              function (q) {
                var te = R[V][1][q];
                return K(te || q);
              },
              X,
              X.exports,
              $,
              R,
              M,
              k,
            );
          }
          return M[V].exports;
        }
        for (var I = typeof De == "function" && De, P = 0; P < k.length; P++)
          K(k[P]);
        return K;
      })(
        {
          1: [
            function ($, R, M) {
              (function (k) {
                var K = k.MutationObserver || k.WebKitMutationObserver,
                  I;
                if (K) {
                  var P = 0,
                    V = new K(q),
                    Q = k.document.createTextNode("");
                  (V.observe(Q, { characterData: !0 }),
                    (I = function () {
                      Q.data = P = ++P % 2;
                    }));
                } else if (!k.setImmediate && typeof k.MessageChannel < "u") {
                  var E = new k.MessageChannel();
                  ((E.port1.onmessage = q),
                    (I = function () {
                      E.port2.postMessage(0);
                    }));
                } else
                  "document" in k &&
                  "onreadystatechange" in k.document.createElement("script")
                    ? (I = function () {
                        var T = k.document.createElement("script");
                        ((T.onreadystatechange = function () {
                          (q(),
                            (T.onreadystatechange = null),
                            T.parentNode.removeChild(T),
                            (T = null));
                        }),
                          k.document.documentElement.appendChild(T));
                      })
                    : (I = function () {
                        setTimeout(q, 0);
                      });
                var D,
                  X = [];
                function q() {
                  D = !0;
                  for (var T, p, l = X.length; l; ) {
                    for (p = X, X = [], T = -1; ++T < l; ) p[T]();
                    l = X.length;
                  }
                  D = !1;
                }
                R.exports = te;
                function te(T) {
                  X.push(T) === 1 && !D && I();
                }
              }).call(
                this,
                typeof Ce < "u"
                  ? Ce
                  : typeof self < "u"
                    ? self
                    : typeof window < "u"
                      ? window
                      : {},
              );
            },
            {},
          ],
          2: [
            function ($, R, M) {
              var k = $(1);
              function K() {}
              var I = {},
                P = ["REJECTED"],
                V = ["FULFILLED"],
                Q = ["PENDING"];
              R.exports = E;
              function E(r) {
                if (typeof r != "function")
                  throw new TypeError("resolver must be a function");
                ((this.state = Q),
                  (this.queue = []),
                  (this.outcome = void 0),
                  r !== K && te(this, r));
              }
              ((E.prototype.catch = function (r) {
                return this.then(null, r);
              }),
                (E.prototype.then = function (r, i) {
                  if (
                    (typeof r != "function" && this.state === V) ||
                    (typeof i != "function" && this.state === P)
                  )
                    return this;
                  var B = new this.constructor(K);
                  if (this.state !== Q) {
                    var L = this.state === V ? r : i;
                    X(B, L, this.outcome);
                  } else this.queue.push(new D(B, r, i));
                  return B;
                }));
              function D(r, i, B) {
                ((this.promise = r),
                  typeof i == "function" &&
                    ((this.onFulfilled = i),
                    (this.callFulfilled = this.otherCallFulfilled)),
                  typeof B == "function" &&
                    ((this.onRejected = B),
                    (this.callRejected = this.otherCallRejected)));
              }
              ((D.prototype.callFulfilled = function (r) {
                I.resolve(this.promise, r);
              }),
                (D.prototype.otherCallFulfilled = function (r) {
                  X(this.promise, this.onFulfilled, r);
                }),
                (D.prototype.callRejected = function (r) {
                  I.reject(this.promise, r);
                }),
                (D.prototype.otherCallRejected = function (r) {
                  X(this.promise, this.onRejected, r);
                }));
              function X(r, i, B) {
                k(function () {
                  var L;
                  try {
                    L = i(B);
                  } catch (H) {
                    return I.reject(r, H);
                  }
                  L === r
                    ? I.reject(
                        r,
                        new TypeError("Cannot resolve promise with itself"),
                      )
                    : I.resolve(r, L);
                });
              }
              ((I.resolve = function (r, i) {
                var B = T(q, i);
                if (B.status === "error") return I.reject(r, B.value);
                var L = B.value;
                if (L) te(r, L);
                else {
                  ((r.state = V), (r.outcome = i));
                  for (var H = -1, ne = r.queue.length; ++H < ne; )
                    r.queue[H].callFulfilled(i);
                }
                return r;
              }),
                (I.reject = function (r, i) {
                  ((r.state = P), (r.outcome = i));
                  for (var B = -1, L = r.queue.length; ++B < L; )
                    r.queue[B].callRejected(i);
                  return r;
                }));
              function q(r) {
                var i = r && r.then;
                if (
                  r &&
                  (typeof r == "object" || typeof r == "function") &&
                  typeof i == "function"
                )
                  return function () {
                    i.apply(r, arguments);
                  };
              }
              function te(r, i) {
                var B = !1;
                function L(ie) {
                  B || ((B = !0), I.reject(r, ie));
                }
                function H(ie) {
                  B || ((B = !0), I.resolve(r, ie));
                }
                function ne() {
                  i(H, L);
                }
                var ae = T(ne);
                ae.status === "error" && L(ae.value);
              }
              function T(r, i) {
                var B = {};
                try {
                  ((B.value = r(i)), (B.status = "success"));
                } catch (L) {
                  ((B.status = "error"), (B.value = L));
                }
                return B;
              }
              E.resolve = p;
              function p(r) {
                return r instanceof this ? r : I.resolve(new this(K), r);
              }
              E.reject = l;
              function l(r) {
                var i = new this(K);
                return I.reject(i, r);
              }
              E.all = o;
              function o(r) {
                var i = this;
                if (Object.prototype.toString.call(r) !== "[object Array]")
                  return this.reject(new TypeError("must be an array"));
                var B = r.length,
                  L = !1;
                if (!B) return this.resolve([]);
                for (
                  var H = new Array(B), ne = 0, ae = -1, ie = new this(K);
                  ++ae < B;

                )
                  ue(r[ae], ae);
                return ie;
                function ue(pe, be) {
                  i.resolve(pe).then(Se, function (ce) {
                    L || ((L = !0), I.reject(ie, ce));
                  });
                  function Se(ce) {
                    ((H[be] = ce),
                      ++ne === B && !L && ((L = !0), I.resolve(ie, H)));
                  }
                }
              }
              E.race = n;
              function n(r) {
                var i = this;
                if (Object.prototype.toString.call(r) !== "[object Array]")
                  return this.reject(new TypeError("must be an array"));
                var B = r.length,
                  L = !1;
                if (!B) return this.resolve([]);
                for (var H = -1, ne = new this(K); ++H < B; ) ae(r[H]);
                return ne;
                function ae(ie) {
                  i.resolve(ie).then(
                    function (ue) {
                      L || ((L = !0), I.resolve(ne, ue));
                    },
                    function (ue) {
                      L || ((L = !0), I.reject(ne, ue));
                    },
                  );
                }
              }
            },
            { 1: 1 },
          ],
          3: [
            function ($, R, M) {
              (function (k) {
                typeof k.Promise != "function" && (k.Promise = $(2));
              }).call(
                this,
                typeof Ce < "u"
                  ? Ce
                  : typeof self < "u"
                    ? self
                    : typeof window < "u"
                      ? window
                      : {},
              );
            },
            { 2: 2 },
          ],
          4: [
            function ($, R, M) {
              var k =
                typeof Symbol == "function" &&
                typeof Symbol.iterator == "symbol"
                  ? function (e) {
                      return typeof e;
                    }
                  : function (e) {
                      return e &&
                        typeof Symbol == "function" &&
                        e.constructor === Symbol &&
                        e !== Symbol.prototype
                        ? "symbol"
                        : typeof e;
                    };
              function K(e, a) {
                if (!(e instanceof a))
                  throw new TypeError("Cannot call a class as a function");
              }
              function I() {
                try {
                  if (typeof indexedDB < "u") return indexedDB;
                  if (typeof webkitIndexedDB < "u") return webkitIndexedDB;
                  if (typeof mozIndexedDB < "u") return mozIndexedDB;
                  if (typeof OIndexedDB < "u") return OIndexedDB;
                  if (typeof msIndexedDB < "u") return msIndexedDB;
                } catch {
                  return;
                }
              }
              var P = I();
              function V() {
                try {
                  if (!P || !P.open) return !1;
                  var e =
                      typeof openDatabase < "u" &&
                      /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) &&
                      !/Chrome/.test(navigator.userAgent) &&
                      !/BlackBerry/.test(navigator.platform),
                    a =
                      typeof fetch == "function" &&
                      fetch.toString().indexOf("[native code") !== -1;
                  return (
                    (!e || a) &&
                    typeof indexedDB < "u" &&
                    typeof IDBKeyRange < "u"
                  );
                } catch {
                  return !1;
                }
              }
              function Q(e, a) {
                ((e = e || []), (a = a || {}));
                try {
                  return new Blob(e, a);
                } catch (s) {
                  if (s.name !== "TypeError") throw s;
                  for (
                    var t =
                        typeof BlobBuilder < "u"
                          ? BlobBuilder
                          : typeof MSBlobBuilder < "u"
                            ? MSBlobBuilder
                            : typeof MozBlobBuilder < "u"
                              ? MozBlobBuilder
                              : WebKitBlobBuilder,
                      u = new t(),
                      c = 0;
                    c < e.length;
                    c += 1
                  )
                    u.append(e[c]);
                  return u.getBlob(a.type);
                }
              }
              typeof Promise > "u" && $(3);
              var E = Promise;
              function D(e, a) {
                a &&
                  e.then(
                    function (t) {
                      a(null, t);
                    },
                    function (t) {
                      a(t);
                    },
                  );
              }
              function X(e, a, t) {
                (typeof a == "function" && e.then(a),
                  typeof t == "function" && e.catch(t));
              }
              function q(e) {
                return (
                  typeof e != "string" &&
                    (console.warn(
                      e + " used as a key, but it is not a string.",
                    ),
                    (e = String(e))),
                  e
                );
              }
              function te() {
                if (
                  arguments.length &&
                  typeof arguments[arguments.length - 1] == "function"
                )
                  return arguments[arguments.length - 1];
              }
              var T = "local-forage-detect-blob-support",
                p = void 0,
                l = {},
                o = Object.prototype.toString,
                n = "readonly",
                r = "readwrite";
              function i(e) {
                for (
                  var a = e.length,
                    t = new ArrayBuffer(a),
                    u = new Uint8Array(t),
                    c = 0;
                  c < a;
                  c++
                )
                  u[c] = e.charCodeAt(c);
                return t;
              }
              function B(e) {
                return new E(function (a) {
                  var t = e.transaction(T, r),
                    u = Q([""]);
                  (t.objectStore(T).put(u, "key"),
                    (t.onabort = function (c) {
                      (c.preventDefault(), c.stopPropagation(), a(!1));
                    }),
                    (t.oncomplete = function () {
                      var c = navigator.userAgent.match(/Chrome\/(\d+)/),
                        s = navigator.userAgent.match(/Edge\//);
                      a(s || !c || parseInt(c[1], 10) >= 43);
                    }));
                }).catch(function () {
                  return !1;
                });
              }
              function L(e) {
                return typeof p == "boolean"
                  ? E.resolve(p)
                  : B(e).then(function (a) {
                      return ((p = a), p);
                    });
              }
              function H(e) {
                var a = l[e.name],
                  t = {};
                ((t.promise = new E(function (u, c) {
                  ((t.resolve = u), (t.reject = c));
                })),
                  a.deferredOperations.push(t),
                  a.dbReady
                    ? (a.dbReady = a.dbReady.then(function () {
                        return t.promise;
                      }))
                    : (a.dbReady = t.promise));
              }
              function ne(e) {
                var a = l[e.name],
                  t = a.deferredOperations.pop();
                if (t) return (t.resolve(), t.promise);
              }
              function ae(e, a) {
                var t = l[e.name],
                  u = t.deferredOperations.pop();
                if (u) return (u.reject(a), u.promise);
              }
              function ie(e, a) {
                return new E(function (t, u) {
                  if (((l[e.name] = l[e.name] || Fe()), e.db))
                    if (a) (H(e), e.db.close());
                    else return t(e.db);
                  var c = [e.name];
                  a && c.push(e.version);
                  var s = P.open.apply(P, c);
                  (a &&
                    (s.onupgradeneeded = function (h) {
                      var v = s.result;
                      try {
                        (v.createObjectStore(e.storeName),
                          h.oldVersion <= 1 && v.createObjectStore(T));
                      } catch (y) {
                        if (y.name === "ConstraintError")
                          console.warn(
                            'The database "' +
                              e.name +
                              '" has been upgraded from version ' +
                              h.oldVersion +
                              " to version " +
                              h.newVersion +
                              ', but the storage "' +
                              e.storeName +
                              '" already exists.',
                          );
                        else throw y;
                      }
                    }),
                    (s.onerror = function (h) {
                      (h.preventDefault(), u(s.error));
                    }),
                    (s.onsuccess = function () {
                      var h = s.result;
                      ((h.onversionchange = function (v) {
                        v.target.close();
                      }),
                        t(h),
                        ne(e));
                    }));
                });
              }
              function ue(e) {
                return ie(e, !1);
              }
              function pe(e) {
                return ie(e, !0);
              }
              function be(e, a) {
                if (!e.db) return !0;
                var t = !e.db.objectStoreNames.contains(e.storeName),
                  u = e.version < e.db.version,
                  c = e.version > e.db.version;
                if (
                  (u &&
                    (e.version !== a &&
                      console.warn(
                        'The database "' +
                          e.name +
                          `" can't be downgraded from version ` +
                          e.db.version +
                          " to version " +
                          e.version +
                          ".",
                      ),
                    (e.version = e.db.version)),
                  c || t)
                ) {
                  if (t) {
                    var s = e.db.version + 1;
                    s > e.version && (e.version = s);
                  }
                  return !0;
                }
                return !1;
              }
              function Se(e) {
                return new E(function (a, t) {
                  var u = new FileReader();
                  ((u.onerror = t),
                    (u.onloadend = function (c) {
                      var s = btoa(c.target.result || "");
                      a({
                        __local_forage_encoded_blob: !0,
                        data: s,
                        type: e.type,
                      });
                    }),
                    u.readAsBinaryString(e));
                });
              }
              function ce(e) {
                var a = i(atob(e.data));
                return Q([a], { type: e.type });
              }
              function Te(e) {
                return e && e.__local_forage_encoded_blob;
              }
              function xe(e) {
                var a = this,
                  t = a._initReady().then(function () {
                    var u = l[a._dbInfo.name];
                    if (u && u.dbReady) return u.dbReady;
                  });
                return (X(t, e, e), t);
              }
              function Ee(e) {
                H(e);
                for (
                  var a = l[e.name], t = a.forages, u = 0;
                  u < t.length;
                  u++
                ) {
                  var c = t[u];
                  c._dbInfo.db && (c._dbInfo.db.close(), (c._dbInfo.db = null));
                }
                return (
                  (e.db = null),
                  ue(e)
                    .then(function (s) {
                      return ((e.db = s), be(e) ? pe(e) : s);
                    })
                    .then(function (s) {
                      e.db = a.db = s;
                      for (var h = 0; h < t.length; h++) t[h]._dbInfo.db = s;
                    })
                    .catch(function (s) {
                      throw (ae(e, s), s);
                    })
                );
              }
              function le(e, a, t, u) {
                u === void 0 && (u = 1);
                try {
                  var c = e.db.transaction(e.storeName, a);
                  t(null, c);
                } catch (s) {
                  if (
                    u > 0 &&
                    (!e.db ||
                      s.name === "InvalidStateError" ||
                      s.name === "NotFoundError")
                  )
                    return E.resolve()
                      .then(function () {
                        if (
                          !e.db ||
                          (s.name === "NotFoundError" &&
                            !e.db.objectStoreNames.contains(e.storeName) &&
                            e.version <= e.db.version)
                        )
                          return (
                            e.db && (e.version = e.db.version + 1),
                            pe(e)
                          );
                      })
                      .then(function () {
                        return Ee(e).then(function () {
                          le(e, a, t, u - 1);
                        });
                      })
                      .catch(t);
                  t(s);
                }
              }
              function Fe() {
                return {
                  forages: [],
                  db: null,
                  dbReady: null,
                  deferredOperations: [],
                };
              }
              function Me(e) {
                var a = this,
                  t = { db: null };
                if (e) for (var u in e) t[u] = e[u];
                var c = l[t.name];
                (c || ((c = Fe()), (l[t.name] = c)),
                  c.forages.push(a),
                  a._initReady || ((a._initReady = a.ready), (a.ready = xe)));
                var s = [];
                function h() {
                  return E.resolve();
                }
                for (var v = 0; v < c.forages.length; v++) {
                  var y = c.forages[v];
                  y !== a && s.push(y._initReady().catch(h));
                }
                var b = c.forages.slice(0);
                return E.all(s)
                  .then(function () {
                    return ((t.db = c.db), ue(t));
                  })
                  .then(function (_) {
                    return (
                      (t.db = _),
                      be(t, a._defaultConfig.version) ? pe(t) : _
                    );
                  })
                  .then(function (_) {
                    ((t.db = c.db = _), (a._dbInfo = t));
                    for (var N = 0; N < b.length; N++) {
                      var O = b[N];
                      O !== a &&
                        ((O._dbInfo.db = t.db),
                        (O._dbInfo.version = t.version));
                    }
                  });
              }
              function Ve(e, a) {
                var t = this;
                e = q(e);
                var u = new E(function (c, s) {
                  t.ready()
                    .then(function () {
                      le(t._dbInfo, n, function (h, v) {
                        if (h) return s(h);
                        try {
                          var y = v.objectStore(t._dbInfo.storeName),
                            b = y.get(e);
                          ((b.onsuccess = function () {
                            var _ = b.result;
                            (_ === void 0 && (_ = null),
                              Te(_) && (_ = ce(_)),
                              c(_));
                          }),
                            (b.onerror = function () {
                              s(b.error);
                            }));
                        } catch (_) {
                          s(_);
                        }
                      });
                    })
                    .catch(s);
                });
                return (D(u, a), u);
              }
              function ke(e, a) {
                var t = this,
                  u = new E(function (c, s) {
                    t.ready()
                      .then(function () {
                        le(t._dbInfo, n, function (h, v) {
                          if (h) return s(h);
                          try {
                            var y = v.objectStore(t._dbInfo.storeName),
                              b = y.openCursor(),
                              _ = 1;
                            ((b.onsuccess = function () {
                              var N = b.result;
                              if (N) {
                                var O = N.value;
                                Te(O) && (O = ce(O));
                                var Y = e(O, N.key, _++);
                                Y !== void 0 ? c(Y) : N.continue();
                              } else c();
                            }),
                              (b.onerror = function () {
                                s(b.error);
                              }));
                          } catch (N) {
                            s(N);
                          }
                        });
                      })
                      .catch(s);
                  });
                return (D(u, a), u);
              }
              function f(e, a, t) {
                var u = this;
                e = q(e);
                var c = new E(function (s, h) {
                  var v;
                  u.ready()
                    .then(function () {
                      return (
                        (v = u._dbInfo),
                        o.call(a) === "[object Blob]"
                          ? L(v.db).then(function (y) {
                              return y ? a : Se(a);
                            })
                          : a
                      );
                    })
                    .then(function (y) {
                      le(u._dbInfo, r, function (b, _) {
                        if (b) return h(b);
                        try {
                          var N = _.objectStore(u._dbInfo.storeName);
                          y === null && (y = void 0);
                          var O = N.put(y, e);
                          ((_.oncomplete = function () {
                            (y === void 0 && (y = null), s(y));
                          }),
                            (_.onabort = _.onerror =
                              function () {
                                var Y = O.error ? O.error : O.transaction.error;
                                h(Y);
                              }));
                        } catch (Y) {
                          h(Y);
                        }
                      });
                    })
                    .catch(h);
                });
                return (D(c, t), c);
              }
              function w(e, a) {
                var t = this;
                e = q(e);
                var u = new E(function (c, s) {
                  t.ready()
                    .then(function () {
                      le(t._dbInfo, r, function (h, v) {
                        if (h) return s(h);
                        try {
                          var y = v.objectStore(t._dbInfo.storeName),
                            b = y.delete(e);
                          ((v.oncomplete = function () {
                            c();
                          }),
                            (v.onerror = function () {
                              s(b.error);
                            }),
                            (v.onabort = function () {
                              var _ = b.error ? b.error : b.transaction.error;
                              s(_);
                            }));
                        } catch (_) {
                          s(_);
                        }
                      });
                    })
                    .catch(s);
                });
                return (D(u, a), u);
              }
              function S(e) {
                var a = this,
                  t = new E(function (u, c) {
                    a.ready()
                      .then(function () {
                        le(a._dbInfo, r, function (s, h) {
                          if (s) return c(s);
                          try {
                            var v = h.objectStore(a._dbInfo.storeName),
                              y = v.clear();
                            ((h.oncomplete = function () {
                              u();
                            }),
                              (h.onabort = h.onerror =
                                function () {
                                  var b = y.error
                                    ? y.error
                                    : y.transaction.error;
                                  c(b);
                                }));
                          } catch (b) {
                            c(b);
                          }
                        });
                      })
                      .catch(c);
                  });
                return (D(t, e), t);
              }
              function x(e) {
                var a = this,
                  t = new E(function (u, c) {
                    a.ready()
                      .then(function () {
                        le(a._dbInfo, n, function (s, h) {
                          if (s) return c(s);
                          try {
                            var v = h.objectStore(a._dbInfo.storeName),
                              y = v.count();
                            ((y.onsuccess = function () {
                              u(y.result);
                            }),
                              (y.onerror = function () {
                                c(y.error);
                              }));
                          } catch (b) {
                            c(b);
                          }
                        });
                      })
                      .catch(c);
                  });
                return (D(t, e), t);
              }
              function g(e, a) {
                var t = this,
                  u = new E(function (c, s) {
                    if (e < 0) {
                      c(null);
                      return;
                    }
                    t.ready()
                      .then(function () {
                        le(t._dbInfo, n, function (h, v) {
                          if (h) return s(h);
                          try {
                            var y = v.objectStore(t._dbInfo.storeName),
                              b = !1,
                              _ = y.openKeyCursor();
                            ((_.onsuccess = function () {
                              var N = _.result;
                              if (!N) {
                                c(null);
                                return;
                              }
                              e === 0 || b
                                ? c(N.key)
                                : ((b = !0), N.advance(e));
                            }),
                              (_.onerror = function () {
                                s(_.error);
                              }));
                          } catch (N) {
                            s(N);
                          }
                        });
                      })
                      .catch(s);
                  });
                return (D(u, a), u);
              }
              function A(e) {
                var a = this,
                  t = new E(function (u, c) {
                    a.ready()
                      .then(function () {
                        le(a._dbInfo, n, function (s, h) {
                          if (s) return c(s);
                          try {
                            var v = h.objectStore(a._dbInfo.storeName),
                              y = v.openKeyCursor(),
                              b = [];
                            ((y.onsuccess = function () {
                              var _ = y.result;
                              if (!_) {
                                u(b);
                                return;
                              }
                              (b.push(_.key), _.continue());
                            }),
                              (y.onerror = function () {
                                c(y.error);
                              }));
                          } catch (_) {
                            c(_);
                          }
                        });
                      })
                      .catch(c);
                  });
                return (D(t, e), t);
              }
              function j(e, a) {
                a = te.apply(this, arguments);
                var t = this.config();
                ((e = (typeof e != "function" && e) || {}),
                  e.name ||
                    ((e.name = e.name || t.name),
                    (e.storeName = e.storeName || t.storeName)));
                var u = this,
                  c;
                if (!e.name) c = E.reject("Invalid arguments");
                else {
                  var s = e.name === t.name && u._dbInfo.db,
                    h = s
                      ? E.resolve(u._dbInfo.db)
                      : ue(e).then(function (v) {
                          var y = l[e.name],
                            b = y.forages;
                          y.db = v;
                          for (var _ = 0; _ < b.length; _++)
                            b[_]._dbInfo.db = v;
                          return v;
                        });
                  e.storeName
                    ? (c = h.then(function (v) {
                        if (v.objectStoreNames.contains(e.storeName)) {
                          var y = v.version + 1;
                          H(e);
                          var b = l[e.name],
                            _ = b.forages;
                          v.close();
                          for (var N = 0; N < _.length; N++) {
                            var O = _[N];
                            ((O._dbInfo.db = null), (O._dbInfo.version = y));
                          }
                          var Y = new E(function (W, ee) {
                            var Z = P.open(e.name, y);
                            ((Z.onerror = function (se) {
                              var Ne = Z.result;
                              (Ne.close(), ee(se));
                            }),
                              (Z.onupgradeneeded = function () {
                                var se = Z.result;
                                se.deleteObjectStore(e.storeName);
                              }),
                              (Z.onsuccess = function () {
                                var se = Z.result;
                                (se.close(), W(se));
                              }));
                          });
                          return Y.then(function (W) {
                            b.db = W;
                            for (var ee = 0; ee < _.length; ee++) {
                              var Z = _[ee];
                              ((Z._dbInfo.db = W), ne(Z._dbInfo));
                            }
                          }).catch(function (W) {
                            throw (
                              (ae(e, W) || E.resolve()).catch(function () {}),
                              W
                            );
                          });
                        }
                      }))
                    : (c = h.then(function (v) {
                        H(e);
                        var y = l[e.name],
                          b = y.forages;
                        v.close();
                        for (var _ = 0; _ < b.length; _++) {
                          var N = b[_];
                          N._dbInfo.db = null;
                        }
                        var O = new E(function (Y, W) {
                          var ee = P.deleteDatabase(e.name);
                          ((ee.onerror = function () {
                            var Z = ee.result;
                            (Z && Z.close(), W(ee.error));
                          }),
                            (ee.onblocked = function () {
                              console.warn(
                                'dropInstance blocked for database "' +
                                  e.name +
                                  '" until all open connections are closed',
                              );
                            }),
                            (ee.onsuccess = function () {
                              var Z = ee.result;
                              (Z && Z.close(), Y(Z));
                            }));
                        });
                        return O.then(function (Y) {
                          y.db = Y;
                          for (var W = 0; W < b.length; W++) {
                            var ee = b[W];
                            ne(ee._dbInfo);
                          }
                        }).catch(function (Y) {
                          throw (
                            (ae(e, Y) || E.resolve()).catch(function () {}),
                            Y
                          );
                        });
                      }));
                }
                return (D(c, a), c);
              }
              var z = {
                _driver: "asyncStorage",
                _initStorage: Me,
                _support: V(),
                iterate: ke,
                getItem: Ve,
                setItem: f,
                removeItem: w,
                clear: S,
                length: x,
                key: g,
                keys: A,
                dropInstance: j,
              };
              function F() {
                return typeof openDatabase == "function";
              }
              var U =
                  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
                J = "~~local_forage_type~",
                oe = /^~~local_forage_type~([^~]+)~/,
                G = "__lfsc__:",
                fe = G.length,
                me = "arbf",
                Ie = "blob",
                ht = "si08",
                pt = "ui08",
                mt = "uic8",
                vt = "si16",
                gt = "si32",
                yt = "ur16",
                bt = "ui32",
                _t = "fl32",
                wt = "fl64",
                St = fe + me.length,
                xt = Object.prototype.toString;
              function Et(e) {
                var a = e.length * 0.75,
                  t = e.length,
                  u,
                  c = 0,
                  s,
                  h,
                  v,
                  y;
                e[e.length - 1] === "=" &&
                  (a--, e[e.length - 2] === "=" && a--);
                var b = new ArrayBuffer(a),
                  _ = new Uint8Array(b);
                for (u = 0; u < t; u += 4)
                  ((s = U.indexOf(e[u])),
                    (h = U.indexOf(e[u + 1])),
                    (v = U.indexOf(e[u + 2])),
                    (y = U.indexOf(e[u + 3])),
                    (_[c++] = (s << 2) | (h >> 4)),
                    (_[c++] = ((h & 15) << 4) | (v >> 2)),
                    (_[c++] = ((v & 3) << 6) | (y & 63)));
                return b;
              }
              function je(e) {
                var a = new Uint8Array(e),
                  t = "",
                  u;
                for (u = 0; u < a.length; u += 3)
                  ((t += U[a[u] >> 2]),
                    (t += U[((a[u] & 3) << 4) | (a[u + 1] >> 4)]),
                    (t += U[((a[u + 1] & 15) << 2) | (a[u + 2] >> 6)]),
                    (t += U[a[u + 2] & 63]));
                return (
                  a.length % 3 === 2
                    ? (t = t.substring(0, t.length - 1) + "=")
                    : a.length % 3 === 1 &&
                      (t = t.substring(0, t.length - 2) + "=="),
                  t
                );
              }
              function En(e, a) {
                var t = "";
                if (
                  (e && (t = xt.call(e)),
                  e &&
                    (t === "[object ArrayBuffer]" ||
                      (e.buffer &&
                        xt.call(e.buffer) === "[object ArrayBuffer]")))
                ) {
                  var u,
                    c = G;
                  (e instanceof ArrayBuffer
                    ? ((u = e), (c += me))
                    : ((u = e.buffer),
                      t === "[object Int8Array]"
                        ? (c += ht)
                        : t === "[object Uint8Array]"
                          ? (c += pt)
                          : t === "[object Uint8ClampedArray]"
                            ? (c += mt)
                            : t === "[object Int16Array]"
                              ? (c += vt)
                              : t === "[object Uint16Array]"
                                ? (c += yt)
                                : t === "[object Int32Array]"
                                  ? (c += gt)
                                  : t === "[object Uint32Array]"
                                    ? (c += bt)
                                    : t === "[object Float32Array]"
                                      ? (c += _t)
                                      : t === "[object Float64Array]"
                                        ? (c += wt)
                                        : a(
                                            new Error(
                                              "Failed to get type for BinaryArray",
                                            ),
                                          )),
                    a(c + je(u)));
                } else if (t === "[object Blob]") {
                  var s = new FileReader();
                  ((s.onload = function () {
                    var h = J + e.type + "~" + je(this.result);
                    a(G + Ie + h);
                  }),
                    s.readAsArrayBuffer(e));
                } else
                  try {
                    a(JSON.stringify(e));
                  } catch (h) {
                    (console.error(
                      "Couldn't convert value into a JSON string: ",
                      e,
                    ),
                      a(null, h));
                  }
              }
              function In(e) {
                if (e.substring(0, fe) !== G) return JSON.parse(e);
                var a = e.substring(St),
                  t = e.substring(fe, St),
                  u;
                if (t === Ie && oe.test(a)) {
                  var c = a.match(oe);
                  ((u = c[1]), (a = a.substring(c[0].length)));
                }
                var s = Et(a);
                switch (t) {
                  case me:
                    return s;
                  case Ie:
                    return Q([s], { type: u });
                  case ht:
                    return new Int8Array(s);
                  case pt:
                    return new Uint8Array(s);
                  case mt:
                    return new Uint8ClampedArray(s);
                  case vt:
                    return new Int16Array(s);
                  case yt:
                    return new Uint16Array(s);
                  case gt:
                    return new Int32Array(s);
                  case bt:
                    return new Uint32Array(s);
                  case _t:
                    return new Float32Array(s);
                  case wt:
                    return new Float64Array(s);
                  default:
                    throw new Error("Unkown type: " + t);
                }
              }
              var ze = {
                serialize: En,
                deserialize: In,
                stringToBuffer: Et,
                bufferToString: je,
              };
              function It(e, a, t, u) {
                e.executeSql(
                  "CREATE TABLE IF NOT EXISTS " +
                    a.storeName +
                    " (id INTEGER PRIMARY KEY, key unique, value)",
                  [],
                  t,
                  u,
                );
              }
              function An(e) {
                var a = this,
                  t = { db: null };
                if (e)
                  for (var u in e)
                    t[u] = typeof e[u] != "string" ? e[u].toString() : e[u];
                var c = new E(function (s, h) {
                  try {
                    t.db = openDatabase(
                      t.name,
                      String(t.version),
                      t.description,
                      t.size,
                    );
                  } catch (v) {
                    return h(v);
                  }
                  t.db.transaction(function (v) {
                    It(
                      v,
                      t,
                      function () {
                        ((a._dbInfo = t), s());
                      },
                      function (y, b) {
                        h(b);
                      },
                    );
                  }, h);
                });
                return ((t.serializer = ze), c);
              }
              function he(e, a, t, u, c, s) {
                e.executeSql(
                  t,
                  u,
                  c,
                  function (h, v) {
                    v.code === v.SYNTAX_ERR
                      ? h.executeSql(
                          "SELECT name FROM sqlite_master WHERE type='table' AND name = ?",
                          [a.storeName],
                          function (y, b) {
                            b.rows.length
                              ? s(y, v)
                              : It(
                                  y,
                                  a,
                                  function () {
                                    y.executeSql(t, u, c, s);
                                  },
                                  s,
                                );
                          },
                          s,
                        )
                      : s(h, v);
                  },
                  s,
                );
              }
              function Nn(e, a) {
                var t = this;
                e = q(e);
                var u = new E(function (c, s) {
                  t.ready()
                    .then(function () {
                      var h = t._dbInfo;
                      h.db.transaction(function (v) {
                        he(
                          v,
                          h,
                          "SELECT * FROM " +
                            h.storeName +
                            " WHERE key = ? LIMIT 1",
                          [e],
                          function (y, b) {
                            var _ = b.rows.length ? b.rows.item(0).value : null;
                            (_ && (_ = h.serializer.deserialize(_)), c(_));
                          },
                          function (y, b) {
                            s(b);
                          },
                        );
                      });
                    })
                    .catch(s);
                });
                return (D(u, a), u);
              }
              function Cn(e, a) {
                var t = this,
                  u = new E(function (c, s) {
                    t.ready()
                      .then(function () {
                        var h = t._dbInfo;
                        h.db.transaction(function (v) {
                          he(
                            v,
                            h,
                            "SELECT * FROM " + h.storeName,
                            [],
                            function (y, b) {
                              for (
                                var _ = b.rows, N = _.length, O = 0;
                                O < N;
                                O++
                              ) {
                                var Y = _.item(O),
                                  W = Y.value;
                                if (
                                  (W && (W = h.serializer.deserialize(W)),
                                  (W = e(W, Y.key, O + 1)),
                                  W !== void 0)
                                ) {
                                  c(W);
                                  return;
                                }
                              }
                              c();
                            },
                            function (y, b) {
                              s(b);
                            },
                          );
                        });
                      })
                      .catch(s);
                  });
                return (D(u, a), u);
              }
              function At(e, a, t, u) {
                var c = this;
                e = q(e);
                var s = new E(function (h, v) {
                  c.ready()
                    .then(function () {
                      a === void 0 && (a = null);
                      var y = a,
                        b = c._dbInfo;
                      b.serializer.serialize(a, function (_, N) {
                        N
                          ? v(N)
                          : b.db.transaction(
                              function (O) {
                                he(
                                  O,
                                  b,
                                  "INSERT OR REPLACE INTO " +
                                    b.storeName +
                                    " (key, value) VALUES (?, ?)",
                                  [e, _],
                                  function () {
                                    h(y);
                                  },
                                  function (Y, W) {
                                    v(W);
                                  },
                                );
                              },
                              function (O) {
                                if (O.code === O.QUOTA_ERR) {
                                  if (u > 0) {
                                    h(At.apply(c, [e, y, t, u - 1]));
                                    return;
                                  }
                                  v(O);
                                }
                              },
                            );
                      });
                    })
                    .catch(v);
                });
                return (D(s, t), s);
              }
              function Bn(e, a, t) {
                return At.apply(this, [e, a, t, 1]);
              }
              function Rn(e, a) {
                var t = this;
                e = q(e);
                var u = new E(function (c, s) {
                  t.ready()
                    .then(function () {
                      var h = t._dbInfo;
                      h.db.transaction(function (v) {
                        he(
                          v,
                          h,
                          "DELETE FROM " + h.storeName + " WHERE key = ?",
                          [e],
                          function () {
                            c();
                          },
                          function (y, b) {
                            s(b);
                          },
                        );
                      });
                    })
                    .catch(s);
                });
                return (D(u, a), u);
              }
              function Dn(e) {
                var a = this,
                  t = new E(function (u, c) {
                    a.ready()
                      .then(function () {
                        var s = a._dbInfo;
                        s.db.transaction(function (h) {
                          he(
                            h,
                            s,
                            "DELETE FROM " + s.storeName,
                            [],
                            function () {
                              u();
                            },
                            function (v, y) {
                              c(y);
                            },
                          );
                        });
                      })
                      .catch(c);
                  });
                return (D(t, e), t);
              }
              function Tn(e) {
                var a = this,
                  t = new E(function (u, c) {
                    a.ready()
                      .then(function () {
                        var s = a._dbInfo;
                        s.db.transaction(function (h) {
                          he(
                            h,
                            s,
                            "SELECT COUNT(key) as c FROM " + s.storeName,
                            [],
                            function (v, y) {
                              var b = y.rows.item(0).c;
                              u(b);
                            },
                            function (v, y) {
                              c(y);
                            },
                          );
                        });
                      })
                      .catch(c);
                  });
                return (D(t, e), t);
              }
              function Fn(e, a) {
                var t = this,
                  u = new E(function (c, s) {
                    t.ready()
                      .then(function () {
                        var h = t._dbInfo;
                        h.db.transaction(function (v) {
                          he(
                            v,
                            h,
                            "SELECT key FROM " +
                              h.storeName +
                              " WHERE id = ? LIMIT 1",
                            [e + 1],
                            function (y, b) {
                              var _ = b.rows.length ? b.rows.item(0).key : null;
                              c(_);
                            },
                            function (y, b) {
                              s(b);
                            },
                          );
                        });
                      })
                      .catch(s);
                  });
                return (D(u, a), u);
              }
              function kn(e) {
                var a = this,
                  t = new E(function (u, c) {
                    a.ready()
                      .then(function () {
                        var s = a._dbInfo;
                        s.db.transaction(function (h) {
                          he(
                            h,
                            s,
                            "SELECT key FROM " + s.storeName,
                            [],
                            function (v, y) {
                              for (var b = [], _ = 0; _ < y.rows.length; _++)
                                b.push(y.rows.item(_).key);
                              u(b);
                            },
                            function (v, y) {
                              c(y);
                            },
                          );
                        });
                      })
                      .catch(c);
                  });
                return (D(t, e), t);
              }
              function Un(e) {
                return new E(function (a, t) {
                  e.transaction(
                    function (u) {
                      u.executeSql(
                        "SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",
                        [],
                        function (c, s) {
                          for (var h = [], v = 0; v < s.rows.length; v++)
                            h.push(s.rows.item(v).name);
                          a({ db: e, storeNames: h });
                        },
                        function (c, s) {
                          t(s);
                        },
                      );
                    },
                    function (u) {
                      t(u);
                    },
                  );
                });
              }
              function Ln(e, a) {
                a = te.apply(this, arguments);
                var t = this.config();
                ((e = (typeof e != "function" && e) || {}),
                  e.name ||
                    ((e.name = e.name || t.name),
                    (e.storeName = e.storeName || t.storeName)));
                var u = this,
                  c;
                return (
                  e.name
                    ? (c = new E(function (s) {
                        var h;
                        (e.name === t.name
                          ? (h = u._dbInfo.db)
                          : (h = openDatabase(e.name, "", "", 0)),
                          e.storeName
                            ? s({ db: h, storeNames: [e.storeName] })
                            : s(Un(h)));
                      }).then(function (s) {
                        return new E(function (h, v) {
                          s.db.transaction(
                            function (y) {
                              function b(Y) {
                                return new E(function (W, ee) {
                                  y.executeSql(
                                    "DROP TABLE IF EXISTS " + Y,
                                    [],
                                    function () {
                                      W();
                                    },
                                    function (Z, se) {
                                      ee(se);
                                    },
                                  );
                                });
                              }
                              for (
                                var _ = [], N = 0, O = s.storeNames.length;
                                N < O;
                                N++
                              )
                                _.push(b(s.storeNames[N]));
                              E.all(_)
                                .then(function () {
                                  h();
                                })
                                .catch(function (Y) {
                                  v(Y);
                                });
                            },
                            function (y) {
                              v(y);
                            },
                          );
                        });
                      }))
                    : (c = E.reject("Invalid arguments")),
                  D(c, a),
                  c
                );
              }
              var Pn = {
                _driver: "webSQLStorage",
                _initStorage: An,
                _support: F(),
                iterate: Cn,
                getItem: Nn,
                setItem: Bn,
                removeItem: Rn,
                clear: Dn,
                length: Tn,
                key: Fn,
                keys: kn,
                dropInstance: Ln,
              };
              function On() {
                try {
                  return (
                    typeof localStorage < "u" &&
                    "setItem" in localStorage &&
                    !!localStorage.setItem
                  );
                } catch {
                  return !1;
                }
              }
              function Nt(e, a) {
                var t = e.name + "/";
                return (
                  e.storeName !== a.storeName && (t += e.storeName + "/"),
                  t
                );
              }
              function $n() {
                var e = "_localforage_support_test";
                try {
                  return (
                    localStorage.setItem(e, !0),
                    localStorage.removeItem(e),
                    !1
                  );
                } catch {
                  return !0;
                }
              }
              function Mn() {
                return !$n() || localStorage.length > 0;
              }
              function Vn(e) {
                var a = this,
                  t = {};
                if (e) for (var u in e) t[u] = e[u];
                return (
                  (t.keyPrefix = Nt(e, a._defaultConfig)),
                  Mn()
                    ? ((a._dbInfo = t), (t.serializer = ze), E.resolve())
                    : E.reject()
                );
              }
              function jn(e) {
                var a = this,
                  t = a.ready().then(function () {
                    for (
                      var u = a._dbInfo.keyPrefix, c = localStorage.length - 1;
                      c >= 0;
                      c--
                    ) {
                      var s = localStorage.key(c);
                      s.indexOf(u) === 0 && localStorage.removeItem(s);
                    }
                  });
                return (D(t, e), t);
              }
              function zn(e, a) {
                var t = this;
                e = q(e);
                var u = t.ready().then(function () {
                  var c = t._dbInfo,
                    s = localStorage.getItem(c.keyPrefix + e);
                  return (s && (s = c.serializer.deserialize(s)), s);
                });
                return (D(u, a), u);
              }
              function Yn(e, a) {
                var t = this,
                  u = t.ready().then(function () {
                    for (
                      var c = t._dbInfo,
                        s = c.keyPrefix,
                        h = s.length,
                        v = localStorage.length,
                        y = 1,
                        b = 0;
                      b < v;
                      b++
                    ) {
                      var _ = localStorage.key(b);
                      if (_.indexOf(s) === 0) {
                        var N = localStorage.getItem(_);
                        if (
                          (N && (N = c.serializer.deserialize(N)),
                          (N = e(N, _.substring(h), y++)),
                          N !== void 0)
                        )
                          return N;
                      }
                    }
                  });
                return (D(u, a), u);
              }
              function Wn(e, a) {
                var t = this,
                  u = t.ready().then(function () {
                    var c = t._dbInfo,
                      s;
                    try {
                      s = localStorage.key(e);
                    } catch {
                      s = null;
                    }
                    return (s && (s = s.substring(c.keyPrefix.length)), s);
                  });
                return (D(u, a), u);
              }
              function qn(e) {
                var a = this,
                  t = a.ready().then(function () {
                    for (
                      var u = a._dbInfo, c = localStorage.length, s = [], h = 0;
                      h < c;
                      h++
                    ) {
                      var v = localStorage.key(h);
                      v.indexOf(u.keyPrefix) === 0 &&
                        s.push(v.substring(u.keyPrefix.length));
                    }
                    return s;
                  });
                return (D(t, e), t);
              }
              function Hn(e) {
                var a = this,
                  t = a.keys().then(function (u) {
                    return u.length;
                  });
                return (D(t, e), t);
              }
              function Xn(e, a) {
                var t = this;
                e = q(e);
                var u = t.ready().then(function () {
                  var c = t._dbInfo;
                  localStorage.removeItem(c.keyPrefix + e);
                });
                return (D(u, a), u);
              }
              function Jn(e, a, t) {
                var u = this;
                e = q(e);
                var c = u.ready().then(function () {
                  a === void 0 && (a = null);
                  var s = a;
                  return new E(function (h, v) {
                    var y = u._dbInfo;
                    y.serializer.serialize(a, function (b, _) {
                      if (_) v(_);
                      else
                        try {
                          (localStorage.setItem(y.keyPrefix + e, b), h(s));
                        } catch (N) {
                          ((N.name === "QuotaExceededError" ||
                            N.name === "NS_ERROR_DOM_QUOTA_REACHED") &&
                            v(N),
                            v(N));
                        }
                    });
                  });
                });
                return (D(c, t), c);
              }
              function Kn(e, a) {
                if (
                  ((a = te.apply(this, arguments)),
                  (e = (typeof e != "function" && e) || {}),
                  !e.name)
                ) {
                  var t = this.config();
                  ((e.name = e.name || t.name),
                    (e.storeName = e.storeName || t.storeName));
                }
                var u = this,
                  c;
                return (
                  e.name
                    ? (c = new E(function (s) {
                        e.storeName
                          ? s(Nt(e, u._defaultConfig))
                          : s(e.name + "/");
                      }).then(function (s) {
                        for (var h = localStorage.length - 1; h >= 0; h--) {
                          var v = localStorage.key(h);
                          v.indexOf(s) === 0 && localStorage.removeItem(v);
                        }
                      }))
                    : (c = E.reject("Invalid arguments")),
                  D(c, a),
                  c
                );
              }
              var Gn = {
                  _driver: "localStorageWrapper",
                  _initStorage: Vn,
                  _support: On(),
                  iterate: Yn,
                  getItem: zn,
                  setItem: Jn,
                  removeItem: Xn,
                  clear: jn,
                  length: Hn,
                  key: Wn,
                  keys: qn,
                  dropInstance: Kn,
                },
                Qn = function (a, t) {
                  return (
                    a === t ||
                    (typeof a == "number" &&
                      typeof t == "number" &&
                      isNaN(a) &&
                      isNaN(t))
                  );
                },
                Zn = function (a, t) {
                  for (var u = a.length, c = 0; c < u; ) {
                    if (Qn(a[c], t)) return !0;
                    c++;
                  }
                  return !1;
                },
                Ct =
                  Array.isArray ||
                  function (e) {
                    return (
                      Object.prototype.toString.call(e) === "[object Array]"
                    );
                  },
                Ae = {},
                Bt = {},
                _e = { INDEXEDDB: z, WEBSQL: Pn, LOCALSTORAGE: Gn },
                er = [
                  _e.INDEXEDDB._driver,
                  _e.WEBSQL._driver,
                  _e.LOCALSTORAGE._driver,
                ],
                Ue = ["dropInstance"],
                Ye = [
                  "clear",
                  "getItem",
                  "iterate",
                  "key",
                  "keys",
                  "length",
                  "removeItem",
                  "setItem",
                ].concat(Ue),
                tr = {
                  description: "",
                  driver: er.slice(),
                  name: "localforage",
                  size: 4980736,
                  storeName: "keyvaluepairs",
                  version: 1,
                };
              function nr(e, a) {
                e[a] = function () {
                  var t = arguments;
                  return e.ready().then(function () {
                    return e[a].apply(e, t);
                  });
                };
              }
              function We() {
                for (var e = 1; e < arguments.length; e++) {
                  var a = arguments[e];
                  if (a)
                    for (var t in a)
                      a.hasOwnProperty(t) &&
                        (Ct(a[t])
                          ? (arguments[0][t] = a[t].slice())
                          : (arguments[0][t] = a[t]));
                }
                return arguments[0];
              }
              var rr = (function () {
                  function e(a) {
                    K(this, e);
                    for (var t in _e)
                      if (_e.hasOwnProperty(t)) {
                        var u = _e[t],
                          c = u._driver;
                        ((this[t] = c), Ae[c] || this.defineDriver(u));
                      }
                    ((this._defaultConfig = We({}, tr)),
                      (this._config = We({}, this._defaultConfig, a)),
                      (this._driverSet = null),
                      (this._initDriver = null),
                      (this._ready = !1),
                      (this._dbInfo = null),
                      this._wrapLibraryMethodsWithReady(),
                      this.setDriver(this._config.driver).catch(
                        function () {},
                      ));
                  }
                  return (
                    (e.prototype.config = function (t) {
                      if ((typeof t > "u" ? "undefined" : k(t)) === "object") {
                        if (this._ready)
                          return new Error(
                            "Can't call config() after localforage has been used.",
                          );
                        for (var u in t) {
                          if (
                            (u === "storeName" &&
                              (t[u] = t[u].replace(/\W/g, "_")),
                            u === "version" && typeof t[u] != "number")
                          )
                            return new Error(
                              "Database version must be a number.",
                            );
                          this._config[u] = t[u];
                        }
                        return "driver" in t && t.driver
                          ? this.setDriver(this._config.driver)
                          : !0;
                      } else
                        return typeof t == "string"
                          ? this._config[t]
                          : this._config;
                    }),
                    (e.prototype.defineDriver = function (t, u, c) {
                      var s = new E(function (h, v) {
                        try {
                          var y = t._driver,
                            b = new Error(
                              "Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver",
                            );
                          if (!t._driver) {
                            v(b);
                            return;
                          }
                          for (
                            var _ = Ye.concat("_initStorage"),
                              N = 0,
                              O = _.length;
                            N < O;
                            N++
                          ) {
                            var Y = _[N],
                              W = !Zn(Ue, Y);
                            if ((W || t[Y]) && typeof t[Y] != "function") {
                              v(b);
                              return;
                            }
                          }
                          var ee = function () {
                            for (
                              var Ne = function (ir) {
                                  return function () {
                                    var sr = new Error(
                                        "Method " +
                                          ir +
                                          " is not implemented by the current driver",
                                      ),
                                      Rt = E.reject(sr);
                                    return (
                                      D(Rt, arguments[arguments.length - 1]),
                                      Rt
                                    );
                                  };
                                },
                                qe = 0,
                                ar = Ue.length;
                              qe < ar;
                              qe++
                            ) {
                              var He = Ue[qe];
                              t[He] || (t[He] = Ne(He));
                            }
                          };
                          ee();
                          var Z = function (Ne) {
                            (Ae[y] &&
                              console.info(
                                "Redefining LocalForage driver: " + y,
                              ),
                              (Ae[y] = t),
                              (Bt[y] = Ne),
                              h());
                          };
                          "_support" in t
                            ? t._support && typeof t._support == "function"
                              ? t._support().then(Z, v)
                              : Z(!!t._support)
                            : Z(!0);
                        } catch (se) {
                          v(se);
                        }
                      });
                      return (X(s, u, c), s);
                    }),
                    (e.prototype.driver = function () {
                      return this._driver || null;
                    }),
                    (e.prototype.getDriver = function (t, u, c) {
                      var s = Ae[t]
                        ? E.resolve(Ae[t])
                        : E.reject(new Error("Driver not found."));
                      return (X(s, u, c), s);
                    }),
                    (e.prototype.getSerializer = function (t) {
                      var u = E.resolve(ze);
                      return (X(u, t), u);
                    }),
                    (e.prototype.ready = function (t) {
                      var u = this,
                        c = u._driverSet.then(function () {
                          return (
                            u._ready === null && (u._ready = u._initDriver()),
                            u._ready
                          );
                        });
                      return (X(c, t, t), c);
                    }),
                    (e.prototype.setDriver = function (t, u, c) {
                      var s = this;
                      Ct(t) || (t = [t]);
                      var h = this._getSupportedDrivers(t);
                      function v() {
                        s._config.driver = s.driver();
                      }
                      function y(N) {
                        return (
                          s._extend(N),
                          v(),
                          (s._ready = s._initStorage(s._config)),
                          s._ready
                        );
                      }
                      function b(N) {
                        return function () {
                          var O = 0;
                          function Y() {
                            for (; O < N.length; ) {
                              var W = N[O];
                              return (
                                O++,
                                (s._dbInfo = null),
                                (s._ready = null),
                                s.getDriver(W).then(y).catch(Y)
                              );
                            }
                            v();
                            var ee = new Error(
                              "No available storage method found.",
                            );
                            return (
                              (s._driverSet = E.reject(ee)),
                              s._driverSet
                            );
                          }
                          return Y();
                        };
                      }
                      var _ =
                        this._driverSet !== null
                          ? this._driverSet.catch(function () {
                              return E.resolve();
                            })
                          : E.resolve();
                      return (
                        (this._driverSet = _.then(function () {
                          var N = h[0];
                          return (
                            (s._dbInfo = null),
                            (s._ready = null),
                            s.getDriver(N).then(function (O) {
                              ((s._driver = O._driver),
                                v(),
                                s._wrapLibraryMethodsWithReady(),
                                (s._initDriver = b(h)));
                            })
                          );
                        }).catch(function () {
                          v();
                          var N = new Error(
                            "No available storage method found.",
                          );
                          return ((s._driverSet = E.reject(N)), s._driverSet);
                        })),
                        X(this._driverSet, u, c),
                        this._driverSet
                      );
                    }),
                    (e.prototype.supports = function (t) {
                      return !!Bt[t];
                    }),
                    (e.prototype._extend = function (t) {
                      We(this, t);
                    }),
                    (e.prototype._getSupportedDrivers = function (t) {
                      for (var u = [], c = 0, s = t.length; c < s; c++) {
                        var h = t[c];
                        this.supports(h) && u.push(h);
                      }
                      return u;
                    }),
                    (e.prototype._wrapLibraryMethodsWithReady = function () {
                      for (var t = 0, u = Ye.length; t < u; t++)
                        nr(this, Ye[t]);
                    }),
                    (e.prototype.createInstance = function (t) {
                      return new e(t);
                    }),
                    e
                  );
                })(),
                or = new rr();
              R.exports = or;
            },
            { 3: 3 },
          ],
        },
        {},
        [4],
      )(4);
    });
  })(xn),
    (de.XdeFileUploader = Sn),
    Object.defineProperty(de, Symbol.toStringTag, { value: "Module" }));
});
